mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 13:26:02 +02:00
i8n - if translation not present, use a readable key
This commit is contained in:
@@ -62,11 +62,6 @@
|
||||
async.map(keys, getKey, callback);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* TODO: Not fully converted to server side yet, ideally server should be able to parse whole templates on demand if necessary
|
||||
* fix: translator.load should determine if server side and immediately return appropriate language file.
|
||||
*/
|
||||
translator.translate = function (data, callback) {
|
||||
var keys = data.match(/\[\[.*?\]\]/g),
|
||||
loading = 0;
|
||||
@@ -79,9 +74,11 @@
|
||||
}
|
||||
|
||||
text = text.replace(key, value);
|
||||
} else {
|
||||
var string = key.split(':');
|
||||
text = text.replace(key, string[string.length-1].replace(/\]+$/, ''));
|
||||
}
|
||||
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user