Select to view content in your preferred language

measure tool localization

4227
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
17 Replies
Mindaugas_ižas
Emerging Contributor
I would not suggest to use localization bundle as I had some with measurement widget. the only way out was just set string values in javascript (Lithuanian):

    esri.bundle.widgets.measurement.NLS_area = "Plotas";
    esri.bundle.widgets.measurement.NLS_area_acres = "Akrai";
    esri.bundle.widgets.measurement.NLS_area_sq_feet = "Kv. p�?da";
    esri.bundle.widgets.measurement.NLS_area_sq_kilometers = "Kv. kilometrų";
    esri.bundle.widgets.measurement.NLS_area_hectares = "Hektarai";
    esri.bundle.widgets.measurement.NLS_area_sq_meters = "m²";
    esri.bundle.widgets.measurement.NLS_area_sq_miles = "Kv. mylių";
    esri.bundle.widgets.measurement.NLS_area_sq_yards = "Kv. Jardai";
    esri.bundle.widgets.measurement.NLS_decimal_degrees = "laipsniai";
    esri.bundle.widgets.measurement.NLS_length_kilometers = "kilometrai";
    esri.bundle.widgets.measurement.NLS_distance = "Atstumas";
    esri.bundle.widgets.measurement.NLS_latitude = "Platuma";
    esri.bundle.widgets.measurement.NLS_length_feet = "p�?dos";
    esri.bundle.widgets.measurement.NLS_length_meters = "m.";
    esri.bundle.widgets.measurement.NLS_length_miles = "mylios";
    esri.bundle.widgets.measurement.NLS_length_yards = "jardai";
    esri.bundle.widgets.measurement.NLS_location = "Pad�?tis";
    esri.bundle.widgets.measurement.NLS_longitude = "Ilguma";
    esri.bundle.widgets.measurement.NLS_resultLabel = "Rezultatas:";
0 Kudos
AntigoniKoffa
Esri Contributor
Hi all !
@saroussi
To answer your second question about eliminating the location button

measurement.hideTool("location"); where measurement is the variable used for the declaration of the widget.
0 Kudos
AntigoniKoffa
Esri Contributor
hi Antigoni Koffa
is it possible to remove some of measures in the area ,length dropbox ?
we dont use hectares , or feet.


Hi,
I have also searched if it is possible to do that but i haven't found a way yet. If i manage to do it, i will keep you informed.
0 Kudos
BarbaraBorn
New Contributor
Is there already a solution how to hide some units?
0 Kudos
MatejSkerjanc
Regular Contributor
the esri.bundle.widgets no longer exists in the 3.4 (i started using the 3.4 now). Does anyone know how to localize the measurement widget now?

Thank you


regards,
Matej
0 Kudos
MatejSkerjanc
Regular Contributor
The above statement is wrong,
the bundle exists and its easily accessible via

require(["dojo/i18n!esri/nls/jsapi",  "esri/dijit/Measurement"],
            function (bundle, Measurement)
            {
               .....
                    bundle.widgets.measurement.NLS_area = i18n.tools.x_config.NLS.area;
                    bundle.widgets.measurement.NLS_area_acres = i18n.tools.x_config.NLS.area_acres;
           


just dont use dojoConfig.locale with wrong language identifier. In my case i used 'sl-SL' instead of 'sl'. With 'sl' everythign started working. You can see the language (if it's not forced with dojoConfig.locale) from the "browser" object "navigator.language". Hope this clears up the mess i've made with last post.


Regards,
Matej
martinpodboj
Deactivated User

Hello,

can someone describe how to localize this tool in Slovenian because in JSAPI there is sl locale but it doesn't work.

Thanks in advance

Martin

0 Kudos
AntigoniKoffa
Esri Contributor

Hello Martin,

you can include "dojo/i18n!esri/nls/jsapi" and then in your function declare the following, where in the string translation, you define the corresponding Slovenian one.

         esri.bundle.widgets.measurement.NLS_area = "translation";

        esri.bundle.widgets.measurement.NLS_area_acres = "translation";

        esri.bundle.widgets.measurement.NLS_area_sq_feet = "translation";

        esri.bundle.widgets.measurement.NLS_area_sq_kilometers = "translation";

        esri.bundle.widgets.measurement.NLS_area_hectares = "translation";

        esri.bundle.widgets.measurement.NLS_area_sq_meters = "translation";

        esri.bundle.widgets.measurement.NLS_area_sq_miles = "translation";

        esri.bundle.widgets.measurement.NLS_area_sq_yards = "translation";

        esri.bundle.widgets.measurement.NLS_length_kilometers = "translation";

        esri.bundle.widgets.measurement.NLS_distance = "translation";

        esri.bundle.widgets.measurement.NLS_length_feet = "translation";

        esri.bundle.widgets.measurement.NLS_length_meters = "translation";

        esri.bundle.widgets.measurement.NLS_length_miles = "translation";

        esri.bundle.widgets.measurement.NLS_length_yards = "translation";

        esri.bundle.widgets.measurement.NLS_resultLabel = "translationΜέτρησης:";

        esri.bundle.widgets.measurement.NLS_decimal_degrees = "translation";

        esri.bundle.widgets.measurement.NLS_latitude = "translation";

        esri.bundle.widgets.measurement.NLS_location = "translation";

        esri.bundle.widgets.measurement.NLS_longitude = "translation";

You can also see the following guide for your reference:

Localization | Guide | ArcGIS API for JavaScript