diff --git a/js/id/id.js b/js/id/id.js index 273a6b846..0283b6ab2 100644 --- a/js/id/id.js +++ b/js/id/id.js @@ -58,9 +58,15 @@ window.iD = function () { return context; }; - context.locale = function(_, path) { - locale = _; + context.locale = function(loc, path) { + locale = loc; localePath = path; + + // Also set iD.detect().locale (unless we detected 'en-us' and openstreetmap wants 'en').. + if (!(loc.toLowerCase() === 'en' && iD.detect().locale.toLowerCase() === 'en-us')) { + iD.detect().locale = loc; + } + return context; }; diff --git a/js/id/ui/scale.js b/js/id/ui/scale.js index d24d00fb9..f49f2ee36 100644 --- a/js/id/ui/scale.js +++ b/js/id/ui/scale.js @@ -1,11 +1,11 @@ iD.ui.Scale = function(context) { var projection = context.projection, - imperial = (iD.detect().locale.toLowerCase() === 'en-us'), maxLength = 180, tickHeight = 8; function scaleDefs(loc1, loc2) { var lat = (loc2[1] + loc1[1]) / 2, + imperial = (iD.detect().locale.toLowerCase() === 'en-us'), conversion = (imperial ? 3.28084 : 1), dist = iD.geo.lonToMeters(loc2[0] - loc1[0], lat) * conversion, scale = { dist: 0, px: 0, text: '' },