From e5ff267073ddff4ecb0e0e46434837764b338c50 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 6 Feb 2014 09:14:06 +0000 Subject: [PATCH] Avoid using one translation as the key for a second Translation keys need to be fixed, so we can't use the result of one lookup to derive the key for another... Fixes #697 --- app/assets/javascripts/leaflet.layers.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/leaflet.layers.js b/app/assets/javascripts/leaflet.layers.js index bb00f716c..443e47e76 100644 --- a/app/assets/javascripts/leaflet.layers.js +++ b/app/assets/javascripts/leaflet.layers.js @@ -121,9 +121,7 @@ L.OSM.layers = function(options) { .appendTo(overlaySection); function addOverlay(layer, name, maxArea) { - var refName = name.split(' ').join('_').toLowerCase(); var item = $('
  • ') - .attr('class', refName) .tooltip({ placement: 'top' }) @@ -139,7 +137,7 @@ L.OSM.layers = function(options) { .prop('checked', checked) .appendTo(label); - label.append(name); + label.append(I18n.t('javascripts.map.layers.' + name)); input.on('change', function() { checked = input.is(':checked'); @@ -170,12 +168,12 @@ L.OSM.layers = function(options) { $(item).attr('class', disabled ? 'disabled' : ''); item.attr('data-original-title', disabled ? - I18n.t('javascripts.site.' + refName + '_zoom_in_tooltip') : ''); + I18n.t('javascripts.site.map_' + name + '_zoom_in_tooltip') : ''); }); } - addOverlay(map.noteLayer, I18n.t('javascripts.map.layers.notes'), OSM.MAX_NOTE_REQUEST_AREA); - addOverlay(map.dataLayer, I18n.t('javascripts.map.layers.data'), OSM.MAX_REQUEST_AREA); + addOverlay(map.noteLayer, 'notes', OSM.MAX_NOTE_REQUEST_AREA); + addOverlay(map.dataLayer, 'data', OSM.MAX_REQUEST_AREA); } options.sidebar.addPane($ui); -- 2.39.5