A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/maps/documentation/routes/localized-values-rm below:

Request localized values | Routes API

Request localized values

Stay organized with collections Save and categorize content based on your preferences.

Localized response values are an additional response field that provides localized text for returned parameter values. Localized text is provided for trip duration, distance, and unit system (metric or imperial). You request localized values using a field mask, and can either specify the language and unit system or use the values inferred by the API. For details, see LocalizedValues.

For example, if you specify a language code for German (de) and imperial units, you get a value for distanceMeters of 49889.7, but also localized text providing that distance measurement in German and imperial units, so "31 Meile."

Here is an example of what you would see for localized values:

{ "localized_values":
  {
    "distance": { "text": "31,0 Meile/n" },
    "duration": { "text": 38 Minuten}.
    "static_duration": { "text": 36 Minuten}.
  }
}
Note: You get two values for the expected duration: duration uses the traffic model you specify, and static_duration does not take traffic into account. So, if your requested traffic model is TRAFFIC_UNAWARE these times are identical.

If you don't specify the language or unit system, the API infers the language and units as follows:

To request localized values

To include localized values in the response, you need to do the following:

  1. Request localized values in your field mask. For example:

    REST

    -H X-Goog-FieldMask: localizedValues

    RPC

    const (fieldMask = "localizedValues")
  2. If you want the localized values in a specific language or unit system, specify the language code and unit system:

    "languageCode": "language_code",
    "units": "METRIC | IMPERIAL",

    For example, this code snippet specifies the language as German (de), and METRIC units:

    "languageCode": "de",
    "units": "METRIC",

    For more information, see Language Support.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-18 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-18 UTC."],[],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4