mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 13:38:26 +02:00
Escape all .s in imagery identifiers, not just the first one
(closes #5737)
This commit is contained in:
@@ -61,13 +61,13 @@ export function rendererBackgroundSource(data) {
|
||||
|
||||
|
||||
source.name = function() {
|
||||
var id_safe = source.id.replace('.', '<TX_DOT>');
|
||||
var id_safe = source.id.replace(/\./g, '<TX_DOT>');
|
||||
return t('imagery.' + id_safe + '.name', { default: name });
|
||||
};
|
||||
|
||||
|
||||
source.description = function() {
|
||||
var id_safe = source.id.replace('.', '<TX_DOT>');
|
||||
var id_safe = source.id.replace(/\./g, '<TX_DOT>');
|
||||
return t('imagery.' + id_safe + '.description', { default: description });
|
||||
};
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ export function uiAttribution(context) {
|
||||
}
|
||||
|
||||
|
||||
var id_safe = d.id.replace('.', '<TX_DOT>');
|
||||
var id_safe = d.id.replace(/\./g, '<TX_DOT>');
|
||||
var terms_text = t('imagery.' + id_safe + '.attribution.text',
|
||||
{ default: d.terms_text || d.id || d.name() }
|
||||
);
|
||||
|
||||
@@ -3,11 +3,11 @@ var translations = Object.create(null);
|
||||
export var currentLocale = 'en';
|
||||
export var textDirection = 'ltr';
|
||||
|
||||
export function setLocale(_) {
|
||||
if (translations[_] !== undefined) {
|
||||
currentLocale = _;
|
||||
} else if (translations[_.split('-')[0]]) {
|
||||
currentLocale = _.split('-')[0];
|
||||
export function setLocale(val) {
|
||||
if (translations[val] !== undefined) {
|
||||
currentLocale = val;
|
||||
} else if (translations[val.split('-')[0]]) {
|
||||
currentLocale = val.split('-')[0];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ export function t(s, o, loc) {
|
||||
|
||||
var path = s
|
||||
.split('.')
|
||||
.map(function (s) { return s.replace('<TX_DOT>', '.'); })
|
||||
.map(function (s) { return s.replace(/<TX_DOT>/g, '.'); })
|
||||
.reverse();
|
||||
|
||||
var rep = translations[loc];
|
||||
|
||||
Reference in New Issue
Block a user