1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-25 08:09:43 +02:00

Add portuguese language support

This commit is contained in:
KMKZ 2022-07-12 22:14:26 -03:00
parent b510615691
commit cfd7ebd2bf
9 changed files with 773 additions and 3 deletions

View file

@ -9,7 +9,7 @@ import Service, { inject as service } from '@ember/service';
import $ from 'jquery';
export default Service.extend({
langs: { enUS: [], deDE: [] , zhCN: [] },
langs: { enUS: [], deDE: [] , zhCN: [], ptBR: [] },
locales: [],
session: service(),
@ -24,6 +24,9 @@ export default Service.extend({
$.getJSON("/i18n/zh-CN.json", (data) => {
this.langs.zhCN = data;
});
$.getJSON("/i18n/pt-BR.json", (data) => {
this.langs.ptBR = data;
});
},
localize(key, ...args) {
@ -39,6 +42,9 @@ export default Service.extend({
case "zh-CN":
str = this.langs.zhCN[key];
break;
case "pt-BR":
str = this.langs.ptBR[key];
break;
}
if (_.isUndefined(str)) {