mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 13:38:26 +02:00
@@ -31,12 +31,14 @@ export function rendererBackgroundSource(data) {
|
||||
|
||||
|
||||
source.name = function() {
|
||||
return t('imagery.' + source.id + '.name', { default: name });
|
||||
var id_safe = source.id.replace('.', '<TX_DOT>');
|
||||
return t('imagery.' + id_safe + '.name', { default: name });
|
||||
};
|
||||
|
||||
|
||||
source.description = function() {
|
||||
return t('imagery.' + source.id + '.description', { default: description });
|
||||
var id_safe = source.id.replace('.', '<TX_DOT>');
|
||||
return t('imagery.' + id_safe + '.description', { default: description });
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -44,7 +44,8 @@ export function uiAttribution(context) {
|
||||
}
|
||||
|
||||
|
||||
var terms_text = t('imagery.' + d.id + '.attribution.text',
|
||||
var id_safe = d.id.replace('.', '<TX_DOT>');
|
||||
var terms_text = t('imagery.' + id_safe + '.attribution.text',
|
||||
{ default: d.terms_text || d.id || d.name() }
|
||||
);
|
||||
|
||||
|
||||
@@ -25,7 +25,11 @@ export function addTranslation(id, value) {
|
||||
export function t(s, o, loc) {
|
||||
loc = loc || currentLocale;
|
||||
|
||||
var path = s.split('.').reverse();
|
||||
var path = s
|
||||
.split('.')
|
||||
.map(function(s) { return s.replace('<TX_DOT>', '.'); })
|
||||
.reverse();
|
||||
|
||||
var rep = translations[loc];
|
||||
|
||||
while (rep !== undefined && path.length) rep = rep[path.pop()];
|
||||
|
||||
Reference in New Issue
Block a user