API v 1.7 nls strings

964
2
08-14-2012 08:04 AM
RaviKonaparthi
New Contributor II
Hi,

Can anyone help me in how to use nls folder in custom widget implementation. When i am trying to point the nls folder it is referring to the AGS JS API (http://serverapi.arcgisonline.com/jsapi/arcgis/3.1compact/js/dojo/dojo/com/esri/template/nls/localiz...)

Here is how i am implementing nls:

require(["esri/map", "dojo/i18n"],
function (map, i18nStrings) {
          dojo.requireLocalization("com.esri.template", "localizedStrings");
          var nlsStrings = dojo.i18n.getLocalization("com.esri.template", "localizedStrings");
});


Any my nls file content is

{
    "outsideArea": "You are currently outside the supported area",
    "geoLocationTimeOut": "Timeout exceeded. Unable to perform the operation",
    "positionUnavailable": "Position unavailable",
    "permissionDenied": "Permission denied to locate current location",
}

Regards,
Ravi.
0 Kudos
2 Replies
KellyHutchins
Esri Frequent Contributor
Hi Ravi,

Sounds like you are trying to create a localization file for a custom widget? If so it might help to download the code associated with the Elevation Profile Template. This template includes a custom widget that calculates the elevation profile - to see the widget code check out the files in the apl folder.

http://www.arcgis.com/home/item.html?id=3b65b141041044ca97d83eb8264da08c
0 Kudos
RaviKonaparthi
New Contributor II
Hi Kelly,

Thank you. The sample worked. But just want to check is there any way to load the nls strings using dojo AMD loader?

Regards,
Ravi.
0 Kudos