Set OpenLayers lang unobtrusively
We output the locale code as the lang attribute, so use that rather than interpolating into embedded JS.
This commit is contained in:
parent
2ce968b571
commit
dcb25f0c07
6 changed files with 3 additions and 11 deletions
|
@ -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'));
|
||||
|
|
|
@ -41,8 +41,6 @@
|
|||
|
||||
<% if map.instance_of? Changeset or (map.instance_of? Node and map.version > 1) or map.visible %>
|
||||
<script type="text/javascript">
|
||||
OpenLayers.Lang.setCode("<%= I18n.locale.to_s %>");
|
||||
|
||||
function remoteEditHandler(event, bbox, select) {
|
||||
var left = bbox.left - 0.0001;
|
||||
var top = bbox.top + 0.0001;
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
OpenLayers.Lang.setCode("<%= I18n.locale.to_s %>");
|
||||
|
||||
var highlight;
|
||||
|
||||
function highlightChangeset(id) {
|
||||
|
|
|
@ -56,8 +56,6 @@
|
|||
<!--
|
||||
var marker;
|
||||
|
||||
OpenLayers.Lang.setCode("<%= I18n.locale.to_s %>");
|
||||
|
||||
function setLocation( e ) {
|
||||
closeMapPopup();
|
||||
|
||||
|
|
|
@ -134,8 +134,6 @@ end
|
|||
var marker;
|
||||
var map;
|
||||
|
||||
OpenLayers.Lang.setCode("<%= I18n.locale.to_s %>");
|
||||
|
||||
function mapInit(){
|
||||
map = createMap("map");
|
||||
|
||||
|
|
|
@ -20,8 +20,6 @@ end
|
|||
<!--
|
||||
var marker;
|
||||
|
||||
OpenLayers.Lang.setCode("<%= I18n.locale.to_s %>");
|
||||
|
||||
function init(){
|
||||
var centre = new OpenLayers.LonLat(<%= lon %>, <%= lat %>);
|
||||
<% if params[:scale].to_f > 0 then -%>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue