From dcb25f0c07ef0252fb411be35030ead67f5da5d1 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 24 Aug 2012 19:00:59 -0700 Subject: [PATCH] Set OpenLayers lang unobtrusively We output the locale code as the lang attribute, so use that rather than interpolating into embedded JS. --- app/assets/javascripts/openlayers.js.erb | 2 ++ app/views/browse/_map.html.erb | 2 -- app/views/changeset/_map.html.erb | 2 -- app/views/diary_entry/edit.html.erb | 4 +--- app/views/site/index.html.erb | 2 -- app/views/user/_map.html.erb | 2 -- 6 files changed, 3 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/openlayers.js.erb b/app/assets/javascripts/openlayers.js.erb index ebb9578a3..66d991f82 100644 --- a/app/assets/javascripts/openlayers.js.erb +++ b/app/assets/javascripts/openlayers.js.erb @@ -35,3 +35,5 @@ OpenLayers.Util.origGetImageLocation = OpenLayers.Util.getImageLocation; OpenLayers.Util.getImageLocation = function(image) { return OpenLayers.Util.imageURLs[image] || OpenLayers.Util.origGetImageLocation(image); }; + +OpenLayers.Lang.setCode($('html').attr('lang')); diff --git a/app/views/browse/_map.html.erb b/app/views/browse/_map.html.erb index 2c29a0d00..b8077e682 100644 --- a/app/views/browse/_map.html.erb +++ b/app/views/browse/_map.html.erb @@ -41,8 +41,6 @@ <% if map.instance_of? Changeset or (map.instance_of? Node and map.version > 1) or map.visible %>