Select to view content in your preferred language

ArcGIS JavaScript API- Languages

980
4
10-27-2022 08:24 AM
MarlaJohnson
Occasional Contributor

Is there a way using the JavaScript API to toggle from English to Spanish?  Also,is there a way to create a Spanish and English version of a Map Service. 

0 Kudos
4 Replies
BjornSvensson
Esri Regular Contributor

Hi @MarlaJohnson , yes, all the text etc in the widgets are localized. You can set an application to use a specific locale, and/or toggle between locales.  See https://developers.arcgis.com/javascript/latest/localization/

 

require(["esri/intl"], (intl)
...
intl.setLocale("es"); 

 

 

0 Kudos
BjornSvensson
Esri Regular Contributor

@MarlaJohnson wrote:

Also,is there a way to create a Spanish and English version of a Map Service. 


There are different aspects to this.  For layer tites, that show up in LayerList and Legend etc widget, you can specify different layer titles.  If you're using web maps, that would mean maintaining two web maps. Localizing your data is more complicated. Depending on what data you have and how you are using it. As an example, for string data, you could have one field per language. Or you could use Arcade to convert specific types etc into specific localized strings.

asdasd

0 Kudos
MarlaJohnson
Occasional Contributor

I mean more for custom applications built off of the Esri Javascript API 

0 Kudos
MarlaJohnson
Occasional Contributor

Do you know if you can publish two services one in English and one in Spanish. 

 

0 Kudos