Skip to content

Localization in ArcGIS Maps SDK for Kotlin ensures that your applications seamlessly adapt to your users’ language and regional preferences. The SDK's support spans across several languages, includes translated strings, date and number formatting, right-to-left (RTL) bidirectional content and customizable language settings for select API.

How does localization work with ArcGIS Maps SDK for Kotlin?

ArcGIS Maps SDK for Kotlin defaults to your device's current locale. To change the locale, you must change your device settings. If the locale is changed to one of the supported languages, you will see the effect in translated strings, data and number formation, bidirectional content, and localized directions. If your language is not supported, see locale fallback.

While the adaptation of your device's locale is automatic, there are various ways to customize locale settings.

Localization with basemap styles

Basemap styles are customizable with BasemapStyleParameters. You can manually change the language settings on basemap styles to customize label display. BasemapStyleParameters allow you to select a language strategy. A basemap style language strategy determines how to display localized labels. Strategies can show labels in the same language for different locales around the world or use mixed labels, with the local languages. The BasemapStyleLanguageStrategy enumeration offers five options to display localized languages on a basemap.

CaseEffect
ApplicationLocaleAttempts to use the system locale language for basemap labels.
DefaultUses the default language setting for the BasemapStyle.
GlobalUses the global language (English) for basemap labels.
LocalUses local place names for basemap labels.
SpecificUse a specific language.

To specify language preferences on your basemap, create BasemapStyleParameters that specify a BasemapStyleLanguageStrategy with a specific locale or strategy. Then initailize your basemap with the parameters.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
        val basemapStyleParameters = BasemapStyleParameters()
        if (languageIdentifier.isNotBlank()) {
            // Apply a specific language if provided ("zh-CN" for Simplified Chinese, for example).
            basemapStyleParameters.languageStrategy = BasemapStyleLanguageStrategy.Specific(
                locale = Locale.forLanguageTag(languageIdentifier)
            )
        } else {
            // Otherwise, use the system locale language.
            basemapStyleParameters.languageStrategy = BasemapStyleLanguageStrategy.ApplicationLocale
        }
        // Apply the basemap style parameters (including language settings) to the basemap.
        arcGISMap.setBasemap(Basemap(BasemapStyle.ArcGISLightGray, basemapStyleParameters))

Localization in routing

Routing services localize labels and directions according to the current device locale. You can, however, explicitly set the directionsLanguage property for ClosestFacilityParameters and RouteParameters to display the resulting directions in a specified language.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
            val routeParameters = routeTask.createDefaultParameters().getOrElse { error ->
                return@launch showError("Error creating default route parameters: " + error.message)
            }

            routeParameters.apply {
                // Add the stops to the route parameters
                setStops(routeStops)

                // Return driving directions in Spanish
                returnDirections = true
                directionsLanguage = "es"
            }

Localization in portal services

Portal services are a large part of ArcGIS. The portal can perform operations such as updating or adding feature items, which often include sending metadata, including locale information. Locale data can affect items like basemaps, styling, and symbology. Device locale is the default setting but you can set a specific locale with Portal.locale. If the portal does not support the specified locale, the default portal settings are used.

Similarly, the OAuth login page can be localized during initialization with the constructor. If the given locale is not supported by the portal, the OAuth login page will be displayed in the language corresponding to the locale set in the portal or organization settings.

Locale-aware API

Localization includes displaying translated strings and error messages, formatting numbers and dates appropriately, and generating localized travel directions. Some APIs inherently support localization and cannot be customized. The following APIs support localization using the current locale:

Supported languages

ArcGIS Maps SDK for Kotlin has translation support for the locales listed below. In addition to these languages, date and number formatting is supported for any sub-locales.

  • Arabic (ar)
  • Bosnian (bs)
  • Bulgarian (bg)
  • Catalan (ca)
  • Czech (cs)
  • Danish (da)
  • German (de)
  • Greek (el)
  • Spanish (es)
  • Estonian (et)
  • Finnish (fi)
  • French (fr)
  • Hebrew (he, iw)
  • Croatian (hr)
  • Hungarian (hu)
  • Indonesian (id, in)
  • Italian (it)
  • Japanese (ja)
  • Korean (ko)
  • Lithuanian (lt)
  • Latvian (lv)
  • Norwegian Bokmål (nb-NO)
  • Dutch (nl)
  • Norwegian (no)
  • Polish (pl)
  • Portuguese (pt-BR, pt-PT)
  • Romanian (ro)
  • Russian (ru)
  • Slovak (sk)
  • Slovenian (sl)
  • Serbian (sr)
  • Swedish (sv)
  • Thai (th)
  • Turkish (tr)
  • Ukrainian (uk-UA)
  • Vietnamese (vi)
  • Simplified Chinese (zh-CN)
  • Traditional Chinese (zh-HK, zh-TW)

Support for right-to-left (RTL)

ArcGIS Maps SDK for Kotlin provides bidirectional support for supported languages and locales, where applicable. Content and positions with leading and trailing options will be converted to right-to-left for appropriate locales.

Locale fallback

Sub-locales not listed above will get translation strings from their macrolanguages. For example, French Canadian ("fr-CA") will use French ("fr") translation strings, and Mexican Spanish ("es-MX") uses Spanish ("es") translation strings. If there is no supported macrolanguage, the translation strings will fall back to English. Date and number formatting will still use the more specific sub-locale.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.