Change unit spelling to english (metres not meters)

168
4
Jump to solution
09-21-2018 07:48 AM
MarkCooper5
Occasional Contributor II

Hi

I need to change the  spelling of the distance units in a WAB developer app to UK English spelling, ie metres not meters. Specifically, it is the scale bar and measuement apps that in need to change. I have been through all the files in the widget folders and cannot see what to change. I have also looked at the \jimu.js\nls\main.js and made changes to the bits in quotation marks in the units section, butt this has had no effect. Any ideas what else I need to do?

Thanks

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Mark,

   Those values will be coming from the JS API directly and not something in WAB. For that you have to make JS API NLS changes.

Localization | Guide | ArcGIS API for JavaScript 3.25 

require(["dojo/i18n!esri/nls/jsapi"],
  function(bundle) {
    bundle.widgets.measurement.NLS_length_meters = "Metres";
  }
);‍‍‍‍‍

View solution in original post

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Mark,

   Those values will be coming from the JS API directly and not something in WAB. For that you have to make JS API NLS changes.

Localization | Guide | ArcGIS API for JavaScript 3.25 

require(["dojo/i18n!esri/nls/jsapi"],
  function(bundle) {
    bundle.widgets.measurement.NLS_length_meters = "Metres";
  }
);‍‍‍‍‍

View solution in original post

0 Kudos
MarkCooper5
Occasional Contributor II

I have found the main_en.js file in the \WebAppBuilderForArcGIS\client\builder\nls folder, but that doesn't appear to be the correct place as it has no effect. Can you tell be where I will find the file?

Thanks

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Mark,

   As I mentioned earlier it is not a file you will find in WAB. It is part of the core JS API code. If you add the code I posted to your widget or app then you can override the defult JS API strings.

MarkCooper5
Occasional Contributor II

Perfect, thank you. Interestingly the coordinate widget appears to get its units from its on strings.js file in the NLS folder.

0 Kudos