1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 15:49:44 +02:00

i18n admin sections

This commit is contained in:
McMatts 2022-03-02 19:55:52 -05:00
parent a7dac6911c
commit 479d03ba70
9 changed files with 131 additions and 78 deletions

View file

@ -21,8 +21,6 @@ export default Service.extend({
},
localize(key, ...args) {
console.log(this.session.locale);
let str = "";
switch(this.session.locale) {
@ -33,13 +31,15 @@ export default Service.extend({
str = this.langs.enUS[key];
}
if (str === "") {
console.log("i18n miss", key);
return;
if (_.isUndefined(str)) {
console.log(">>>>>>>>>>>> i18n missed key", key);
return `!${key}!`;
}
for (let i = 0; i < args.length; i++) {
str = str.replace(`{${i+1}}`, args[i]);
if (args) {
for (let i = 0; i < args.length; i++) {
str = str.replace(`{${i+1}}`, args[i]);
}
}
return str;