Translation keys need to be fixed, so we can't use the result of
one lookup to derive the key for another...
Fixes #697
.appendTo(overlaySection);
function addOverlay(layer, name, maxArea) {
.appendTo(overlaySection);
function addOverlay(layer, name, maxArea) {
- var refName = name.split(' ').join('_').toLowerCase();
- .attr('class', refName)
.tooltip({
placement: 'top'
})
.tooltip({
placement: 'top'
})
.prop('checked', checked)
.appendTo(label);
.prop('checked', checked)
.appendTo(label);
+ label.append(I18n.t('javascripts.map.layers.' + name));
input.on('change', function() {
checked = input.is(':checked');
input.on('change', function() {
checked = input.is(':checked');
$(item).attr('class', disabled ? 'disabled' : '');
item.attr('data-original-title', disabled ?
$(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);
}
options.sidebar.addPane($ui);