> For the complete documentation index, see [llms.txt](https://docs.mapbox.com/android/ja/navigation/llms.txt)

# Localization and internationalization

Mapbox Navigation SDK enables you to customize the language and units of measurement used by both text and voice instructions.

There are several default behaviors built into the SDK:

-   **Language**: The SDK generates banner and voice instructions based on the language provided via options. See guides bellow.
-   **Distance**: The SDK gives distances in the predominant measurement system of the device system's region, which might not necessarily be the same region in which the device is traveling.
-   **Time**: The SDK will express units of time in the predominant system (either twelve or twenty-four-hour based) of the device system's region, which might not necessarily be the same region in which the device is traveling.
-   **Local place names**: The upcoming road or ramp destination is named according to the local or national language. In some regions, the SDK may give the name multiple languages.

You can override these defaults in the Navigation SDK, including:

-   Manually setting the language used in text and voice instructions.
-   Changing the units of distance used.
-   Changing how units of time are formatted.

If no language is specified, the SDK receives the defaults described above. To customize the language or units of measurement used in text and voice instructions, use the `NavigationRoute.Builder` class.

## Supported languages

The following table lists the languages that are supported for user interface elements and spoken instructions.

<table><thead><tr><th>Language</th><th>User interface</th><th>Spoken instructions</th><th>More info</th></tr></thead><tbody><tr><td>Albanian</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Arabic</td><td>✅</td><td>✅</td><td>Depends on the device; might require third-party text-to-speech</td></tr><tr><td>Bahasa (Indonesian)</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Bulgarian</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Chinese (Mandarin - Simplified Characters)</td><td>✅</td><td><br>Mandarin</td><td>Depends on the device; might require third-party text-to-speech</td></tr><tr><td>Chinese (Hong Kong)</td><td>✅</td><td>-</td><td></td></tr><tr><td>Chinese (Taiwan, Mandarin - Traditional Characters)</td><td>✅</td><td><br>Mandarin</td><td>Depends on the device; might require third-party text-to-speech</td></tr><tr><td>Croatian</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Czech</td><td>✅</td><td>-</td><td></td></tr><tr><td>Danish</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Dutch (Belgium)</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Dutch (Holland)</td><td>✅</td><td>✅</td><td></td></tr><tr><td>English (Australia)</td><td>✅</td><td>✅</td><td></td></tr><tr><td>English (India)</td><td>✅</td><td>✅</td><td></td></tr><tr><td>English (Singapore)</td><td>✅</td><td>✅</td><td></td></tr><tr><td>English (United Kingdom)</td><td>✅</td><td>✅</td><td></td></tr><tr><td>English (United States)</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Estonian</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Finnish</td><td>—</td><td>✅</td><td>Depends on the device; might require third-party text-to-speech</td></tr><tr><td>French (Canada)</td><td>✅</td><td>✅</td><td></td></tr><tr><td>French (France)</td><td>✅</td><td>✅</td><td></td></tr><tr><td>German</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Greek</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Hebrew</td><td>✅</td><td>✅</td><td>Depends on the device; might require third-party text-to-speech</td></tr><tr><td>Hungarian</td><td>—</td><td>✅</td><td>Depends on the device; might require third-party text-to-speech</td></tr><tr><td>Icelandic</td><td>-</td><td>✅</td><td></td></tr><tr><td>Italian</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Japanese</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Korean</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Latvian</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Lithuanian</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Malay</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Norwegian (Bokmål)</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Polish</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Portuguese (Brazil)</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Portuguese (Portugal)</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Romanian</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Russian</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Serbian (Cyrillic)</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Slovak</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Slovene</td><td>—</td><td>✅</td><td>Depends on the device; might require third-party text-to-speech</td></tr><tr><td>Spanish (Latin America)</td><td>-</td><td>-</td><td></td></tr><tr><td>Spanish (Mexico)</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Spanish (Spain)</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Swedish</td><td>✅</td><td>✅</td><td></td></tr><tr><td>Thai</td><td>✅</td><td></td><td></td></tr><tr><td>Turkish</td><td>—</td><td>✅</td><td></td></tr><tr><td>Ukrainian</td><td>✅</td><td>✅</td><td>Depends on the device; might require third-party text-to-speech</td></tr><tr><td>Vietnamese</td><td>✅</td><td>✅</td><td>Depends on the device; might require third-party text-to-speech</td></tr></tbody></table>

> **Note: Speech engine**
> 
> For languages marked with `Depends on the device; might require third-party text-to-speech`, instructions are provided by the SDK, but it's not guaranteed that the given device will have the appropriate `TextToSpeech` speech engine installed to pronounce these instructions correctly.

### Voice instruction sources

Turn-by-turn instructions are primarily designed to be announced by either the Mapbox Voice API or by the [Android system's TextToSpeech](https://developer.android.com/reference/android/speech/tts/TextToSpeech). By default, the SDK uses the Mapbox Voice API, which requires an internet connection at various points along the route. If the Voice API lacks support for the turn-by-turn instruction language or there is no internet connection, the `TextToSpeech` system announces the instructions instead.

## Customization

You can override the default language, units of distance, time format, and speed limit units used in instructions and visual components when building your route request and configuring your navigation session.

### Set text instructions language

To retrieve text instructions in a language other than the device's user interface language, pass the desired language through the `RouteOptions.builder()`'s `language` method as you request routes.

If you set a custom language, `true` *must* be passed though the `steps()` method. This `true` ensures that the Directions API response includes turn-by-turn instructions.

Set the text instructions language:

```kotlin
val routeOptions = RouteOptions.builder()
    .coordinatesList(coordinateList)
    .profile(directionsProfile)
    .steps(true)
    .language(languageCode)
    .build()

mapboxNavigation.requestRoutes(routeOptions, callback)
```

If you navigate using map matched routes with [Mapbox Map Matching API](https://docs.mapbox.com/api/navigation/map-matching/) you can pass the desired language through the `MapMatchingOptions.builder()`'s `language` method.

```kotlin
val options = MapMatchingOptions.Builder()
    .language(languageCode)
    .build()
mapboxNavigation.requestMapMatching(options, mapMatchingAPICallback)
```

### Set voice instruction units of measurement

To override the measurement system used in spoken instructions, pass the desired `unit` through the `RouteOptions.builder()`'s `voiceUnits()` method when you request routes.

The units can either be `DirectionsCriteria.IMPERIAL` (the SDK's default) or `DirectionsCriteria.METRIC`.

If you set a desired unit, `true` *must* be passed through **both** the `steps()` and `voiceInstructions()` methods.

Set the units to metric:

```kotlin
val routeOptions = RouteOptions.builder()
    .steps(true)
    .voiceInstructions(true)
    .voiceUnits(DirectionsCriteria.METRIC)
    .build()

mapboxNavigation.requestRoutes(routeOptions, callback)
```

### Set speed limit units

When localizing your navigation experience, you typically configure `RouteOptions` for the instructions and `DistanceFormatterOptions` for the UI components like the speed limit sign.

The units (MP/H versus KM/H) are determined by the `UnitType` passed via `DistanceFormatterOptions`. This allows you to explicitly set the units or match them to the user's localization preferences. `UnitType.METRIC` forces the output to be in Kilometers per hour (KM/H) and `UnitType.IMPERIAL` forces the output to be in Miles per hour (MP/H).

By default, the `DistanceFormatterOptions.Builder` uses the device's locale to automatically determine whether to display speed in MP/H or KM/H. You only need to manually specify the `.unitType()` when you want to provide a specific override for the user.

```kotlin
// 1. Define the unit type (METRIC for KM/H, IMPERIAL for MPH)
val unitType = UnitType.METRIC 

// 2. Create DistanceFormatterOptions with the specified unit type
val distanceFormatterOptions = DistanceFormatterOptions.Builder(context)
    .unitType(unitType)
    .build()

// 3. Request formatted speed data using the options
val speedInfoValue = speedInfoApi.updatePostedAndCurrentSpeed(
    locationMatcherResult,
    distanceFormatterOptions
)
```

### Language of spoken instructions

If you use the SDK framework to [play prompt and detailed voice instructions](https://docs.mapbox.com/android/ja/navigation/v2/guides/ui-components/voice/) you can pass the desired language when your create `MapboxSpeechApi` or `MapboxVoiceInstructionsPlayer`.

### Format time

The [`NavigationOptions`](https://docs.mapbox.com/android/navigation/api/coreframework/3.30.0-rc.1/base/com.mapbox.navigation.base.options/-navigation-options/)'s builder has a `.timeFormatType()` method, which defines the format for the remaining trip time. The method takes either the `TWELVE_HOURS` (11.00PM), `TWENTY_FOUR_HOURS` (23.00), or `NONE_SPECIFIED` constant. `NONE_SPECIFIED` means the format will be defined by the device's current settings independent from your project. The Navigation SDK uses `NONE_SPECIFIED` if no format is passed through `.timeFormatType()`.

Set the format:

```kotlin
val navigationOptions = NavigationOptions.Builder()
	.timeFormatType(TWENTY_FOUR_HOURS)
	.build()
```

Then use the `NavigationOptions` object when you initialize the [`MapboxNavigation` object](https://docs.mapbox.com/android/ja/navigation/v2/guides/get-started/initialization/).