I have setup a WEB APP on ArcGIS online and then I have downloaded it to be hosted locally on our server. I wish to change some text in danish localization to a faroese texts, which serves our purpose.
I was able to change many of the texts by accessing a NLS folder for a widget I want to customize (e.g. query widget "...widgets\Query\nls\Widget_da.js" and change the texts. But some widgets do not have text strings in NLS folder, specifically "measaurement" widget. I have managed to change the lables by adding a following js code to the measurement widget js code, right before the original code starts (see attached image):
require(["dojo/i18n!esri/nls/jsapi"],
function(bundle) {
// bundle.widgets.measurement.NLS_area_sq_kilometers = "km<sup>2</sup>";
// bundle.widgets.measurement.NLS_resultLabel = "Mlæ";
}
);
However, I realize that this is probably not best solution. My questions are:
Thank you
Martin
Solved! Go to Solution.
Martin,
That is coming from the JS API:
require(["dojo/i18n!esri/nls/jsapi"], function(esriJSnls) {
console.log(esriJSnls.widgets.FeatureTable.empty);
});
Martin,
That is the right way to localize strings that are coming from the JS API like the measurement widget. The only thing you can do is add an if statement to check is the browsers locale is danish and apply your string change or not.
Hey Robert.
Do you, or maybe someone else know how to modify the string "- empty -" which is used as placeholder in input field in query widget?
Martin,
That is coming from the JS API:
require(["dojo/i18n!esri/nls/jsapi"], function(esriJSnls) {
console.log(esriJSnls.widgets.FeatureTable.empty);
});
Don't forget to mark this question as answered by clicking on the "Mark Correct" link on the reply that answered your question.