Select to view content in your preferred language

measure tool localization

4224
17
Jump to solution
03-13-2012 05:52 AM
MatejSkerjanc
Regular Contributor
As per title, is it possible to localize the measure tool?
0 Kudos
1 Solution

Accepted Solutions
JohnGrayson
Esri Regular Contributor
The language local will be picked up from the browser settings. One way to force language localizations is to set the locale in dojoConfig.  Find the following tag in your html file and modify accordingly:

<script type="text/javascript">   var dojoConfig = {      parseOnLoad:true,      locale:"es"   }; </script>


More details in the JS API Localization concepts page.

Additionally, you can explicitly override and/or change the measure tool messages as described in the ArcGIS JavaScript API Dijit Text Strings help topic.

View solution in original post

0 Kudos
17 Replies
JianHuang
Deactivated User
Yes. Similar to all JS widgets, measurement widget support 9 different languages. You just need to specify the locale in your config settings.
0 Kudos
MatejSkerjanc
Regular Contributor
Yes. Similar to all JS widgets, measurement widget support 9 different languages. You just need to specify the locale in your config settings.


would you by any chance have any example of this? all i see in the template.js for localization is measure: { title:"sometihing", label: "somelabel"} what i want to localize are those combo box with measurement units and the messages
0 Kudos
JohnGrayson
Esri Regular Contributor
The language local will be picked up from the browser settings. One way to force language localizations is to set the locale in dojoConfig.  Find the following tag in your html file and modify accordingly:

<script type="text/javascript">   var dojoConfig = {      parseOnLoad:true,      locale:"es"   }; </script>


More details in the JS API Localization concepts page.

Additionally, you can explicitly override and/or change the measure tool messages as described in the ArcGIS JavaScript API Dijit Text Strings help topic.
0 Kudos
MatejSkerjanc
Regular Contributor
oh thank you sir, i'll go read on it. Couldn't find anything via google or forum search yet, i bet your links will help.


update 1: tested the locale set it to SL and i get error Bundle not found: jsapi in esri , locale=SL. So i'll go read on it and report back when its done
update 2: upon reading the links i've solved it, just the DEGREES DMS remains to be solved since i cannot find it in the DIJIT text strings settings.
0 Kudos
JianHuang
Deactivated User
What language are you setting to?
0 Kudos
MatejSkerjanc
Regular Contributor
I'm setting it to slovene.
0 Kudos
__Rich_
Deactivated User
hi all
can you  set the language of the measure tool to Hebrew?

From above - http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jshelp_start.htm#jshelp/localization.htm
0 Kudos
__Rich_
Deactivated User
sorry but
i didn't see Hebrew listed there !
am i missing something?

That was the point of the link - it's not listed i.e. not supported out of the box.

But note the page states:

You can define strings for additional locales by creating a new resource bundle file that contains the translated strings. View the Dojo help topic Globalization Guidelines: Locale and Resource Bundle for more details.


In other words, if you supply the translations then you can add support for additional languages.

Have you followed the guidelines and created your own bundle yet?  (I don't know of any samples for this, perhaps another forum member has done it?)
0 Kudos
AdrianMarsden
Honored Contributor
Like lots of things, the measure widget is so close to being good, but needs a few tweaks.  For example changing the list of units for area and length, as well as being able to set a default for the point location tool (as well as changing the list of units) - for example no-one in our organization use long/lat or DMS we use British National Grid - all our data are defined in it and that is the only system we use.

Cheers

ACM

PS Does anyone else have the measure tool suddenly zoom in to almost real world scales on click?  You click and the map zooms into a VERy small area - so small the scale bar breaks with NaN for instead of numbers.??
0 Kudos