Skip to main content

Localization and internationalization

The Mapbox Navigation SDK supports over a dozen major languages as well as some other locale settings. For a seamless user experience, the SDK’s default behavior matches the standard iOS behavior as much as possible, but several customization options are also available for specialized use cases.

User interface

The Mapbox Navigation SDK’s user interface automatically matches your application’s language whenever possible. To improve user experience, you should localize your application fully rather than piecemeal. If you want to display a turn-by-turn navigation experience in a language without first localizing your application, you can add the language to your Xcode project’s languages and add a stub Localizable.strings file to your application target. For more information about preparing your application for additional languages, consult “Localize your app” in Apple developer documentation.

The turn banner names the upcoming road or ramp destination in the local or national language. In some regions, the name may appear in multiple languages or scripts. A label near the bottom bar displays the current road name in the local language as well.

Distances, travel times, and arrival times are displayed according to the system language and region settings by default, regardless of the application’s language.

To override the language set the locale to the distance and time formatters:

// You need to provide the custom topBanner and bottomBanner to override the locale.
let topBanner = TopBannerViewController()
topBanner.instructionsBannerView.distanceFormatter.locale = locale
let bottomBanner = BottomBannerViewController()
bottomBanner.distanceFormatter.locale = locale
bottomBanner.dateFormatter.locale = locale

let navigationOptions = NavigationOptions(
mapboxNavigation: mapboxNavigation,
voiceController: mapboxNavigationProvider.routeVoiceController,
eventsManager: mapboxNavigationProvider.eventsManager(),
topBanner: topBanner,
bottomBanner: bottomBanner
)
let navigationViewController = NavigationViewController(
navigationRoutes: navigationRoutes,
navigationOptions: navigationOptions
)

// You need to set delegate for your custom banners.
topBanner.delegate = navigationViewController
bottomBanner.delegate = navigationViewController

By default, the map inside NavigationViewController displays road labels in the local language, while points of interest and places are displayed in the system’s preferred language, if that language is one of the many supported by the Mapbox Streets source. The user can set the system’s preferred language in Settings, General Settings, Language & Region.

A standalone NavigationMapView labels roads, points of interest, and places in the language specified by the current style. To match the behavior of the map inside NavigationViewController, call the NavigationMapView.localizeLabels() method from within MapboxMap.onStyleLoaded:

var cancellables: Set<AnyCancelable> = []

navigationMapView.mapView.mapboxMap.onStyleLoaded.observeNext { [weak self] _ in
self?.navigationMapView?.localizeLabels()
}.store(in: &cancellables)

Spoken instructions

Turn instructions are announced in the user interface language when turn instructions are available in that language. Otherwise, if turn instructions are unavailable in that language, they are announced in English instead. To have instructions announced in a language other than the user interface language, set the NavigationRouteOptions.locale property when calculating the route with which to start navigation. Turn instructions are primarily designed to be announced by either the Mapbox Voice API or the Speech Synthesis framework built into iOS (also known as AVSpeechSynthesizer or VoiceOver). This SDK uses the Mapbox Voice API by default. If the Voice API lacks support for the turn instruction language, AVSpeechSynthesizer announces the instructions instead. The Voice API requires an Internet connection at various points along the route.

Navigation SDK provides three different configurations of the Text-to-Speech engine that you can set using CoreConfig.ttsConfig property during SDK initialization:

  1. TTSConfig.default – uses MultiplexedSpeechSynthesizer to pronounce instructions using the Mapbox Voice API and can fallback to AVSpeechSynthesizer if the Voice API lacks support for the turn instruction language or the internet connection is unavailable.

  2. TTSConfig.localOnly – always uses AVSpeechSynthesizer to pronounce instructions.

  3. TTSConfig.custom – allows developers to provide their implementation of SpeechSynthesizing protocol that will be used for pronouncing instructions.

By default, the SDK provides distances in the predominant measurement system of the system region, which may not necessarily be the same region in which the user is traveling. To override the measurement system used in spoken instructions, set the RouteOptions.distanceMeasurementSystem property when calculating the route to start navigation.

The upcoming road or ramp destination is named according to the local or national language. In some regions, the name may appear in multiple languages or scripts.

Supported languages

LanguageUser interfaceSpoken instructionsRemarks
ArabicUses VoiceOver
BurmeseRequires third-party text-to-speech
Catalan
Chinese✅ Simplified✅ MandarinUses VoiceOver
Danish
Dutch
English
EsperantoRequires third-party text-to-speech
FinnishUses VoiceOver
French
German
Greek
HebrewUses VoiceOver
HungarianUses VoiceOver
IndonesianUses VoiceOver
Italian
Japanese
Korean
Norwegian
Portuguese
Polish
Romanian
Russian
SlovenianRequires third-party text-to-speech
Spanish
Swedish
Turkish
UkrainianRequires third-party text-to-speech
VietnameseRequires third-party text-to-speech
YorubaRequires third-party text-to-speech
Was this page helpful?