1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-18 20:59:43 +02:00

Merge pull request #397 from armando-marra/master

Modified i18n.js and Readme.md
This commit is contained in:
Harvey Kandola 2023-09-08 12:15:28 -04:00 committed by GitHub
commit cbf5f4be7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -87,6 +87,7 @@ Languages supported out-of-the-box:
- Chinese (中文)
- Portuguese (Brazil) (Português - Brasil)
- Japanese (日本語)
- Italian
PR's welcome for additional languages.

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: [], ptBR: [], frFR: [], jaJP: [] },
langs: { enUS: [], deDE: [] , zhCN: [], ptBR: [], frFR: [], jaJP: [], itIT: [] },
locales: [],
session: service(),
@ -33,6 +33,9 @@ export default Service.extend({
$.getJSON("/i18n/ja-JP.json", (data) => {
this.langs.jaJP = data;
});
$.getJSON("/i18n/it-IT.json", (data) => {
this.langs.itIT = data;
});
},
localize(key, ...args) {
@ -57,6 +60,9 @@ export default Service.extend({
case "ja-JP":
str = this.langs.jaJP[key];
break;
case "it-IT":
str = this.langs.itIT[key];
break;
}
if (_.isUndefined(str)) {