mirror of
https://github.com/documize/community.git
synced 2025-07-24 15:49:44 +02:00
add chinese language support
This commit is contained in:
parent
68d067ef7b
commit
dc26f063c8
7 changed files with 769 additions and 2 deletions
|
@ -9,7 +9,7 @@ import Service, { inject as service } from '@ember/service';
|
|||
import $ from 'jquery';
|
||||
|
||||
export default Service.extend({
|
||||
langs: { enUS: [], deDE: [] },
|
||||
langs: { enUS: [], deDE: [] , zhCN: [] },
|
||||
locales: [],
|
||||
session: service(),
|
||||
|
||||
|
@ -21,6 +21,9 @@ export default Service.extend({
|
|||
$.getJSON("/i18n/de-DE.json", (data) => {
|
||||
this.langs.deDE = data;
|
||||
});
|
||||
$.getJSON("/i18n/zh-CN.json", (data) => {
|
||||
this.langs.zhCN = data;
|
||||
});
|
||||
},
|
||||
|
||||
localize(key, ...args) {
|
||||
|
@ -33,6 +36,9 @@ export default Service.extend({
|
|||
case "de-DE":
|
||||
str = this.langs.deDE[key];
|
||||
break;
|
||||
case "zh-CN":
|
||||
str = this.langs.zhCN[key];
|
||||
break;
|
||||
}
|
||||
|
||||
if (_.isUndefined(str)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue