in java script 3.* there was library "dojo/i18n!esri/nls/jsapi"
require(["esri/map", "dojo/i18n!esri/nls/jsapi", "dojo/domReady!"],
function(Map, bundle) {
bundle.widgets.legend.NLS_noLegend = "My No Legend";
}
);
But it looks that "dojo/i18n!esri/nls/jsapi" is missed in js 4.6. So i can not translate any text.
Is there any other way to localize resources ?
It's slightly different syntax in 4.x Localization | ArcGIS API for JavaScript 4.6
require(["esri/Map", "dojo/i18n!esri/nls/common", "dojo/domReady!"],
function(Map, bundle) {
bundle.form.yes = "Yeah!";
bundle.form.no = "No way!";
}
);
common library does not help. there is no resources of widgets etc
Yes, it looks like it's missing many items. This is probably a good thing to bring up with Support or submit an Idea.
Actually the structure has just changed and the nls file for each widget in not in a common type file it is in it's own specific nls file.
I.e. here is the attribution widget:
https://js.arcgis.com/4.7/esri/widgets/Attribution/nls/Attribution.js
That's very useful information Robert. This really needs to go into the documentation!
Thanks a lot for answer, Robert. It really helps
unfortunately it does not work. i can not translate any text. not sure how to do this in right way. It loads libraries , but when i change any text it does not affect on labels of widget
Sergey,
Sorry you are right it does not work. I am not sure why though. Let me tag some esri folks on this:
It would be great to get any help on this. thank you