diff --git a/package.json b/package.json index 19dc0bc..643010f 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "lesspass": "^6.0.0", "lodash.debounce": "^4.0.8", "vue": "^2.2.2", - "vue-polyglot": "^0.1.4", + "vue-polyglot": "^0.1.5", "vue-router": "^2.3.0", "vuex": "^2.2.1", "vuex-persistedstate": "^1.3.0", diff --git a/scripts/buildI18n.js b/scripts/buildI18n.js index dae6ee6..dfcc84e 100644 --- a/scripts/buildI18n.js +++ b/scripts/buildI18n.js @@ -18,7 +18,7 @@ walker.on("file", (root, fileStats, next) => { }); const I18N_DIR = '../src/i18n'; -const LANGUAGES_AVAILABLE = ['zh', 'fr', 'es', 'uk', 'de', 'it', 'en']; +const LANGUAGES_AVAILABLE = ['zh', 'zh-CN', 'fr', 'es', 'uk', 'de', 'it', 'en']; walker.on("end", () => { LANGUAGES_AVAILABLE.forEach(lang => { const localeFile = path.join(I18N_DIR, `${lang}.json`); @@ -29,9 +29,9 @@ walker.on("end", () => { const localeOrdered = {}; Object.keys(locale).sort().forEach(function(key) { - if(key in existingLocale){ + if (key in existingLocale) { localeOrdered[key] = existingLocale[key]; - }else{ + } else { localeOrdered[key] = locale[key]; } }); diff --git a/src/i18n/fr.json b/src/i18n/fr.json index 351ad51..2e42c19 100644 --- a/src/i18n/fr.json +++ b/src/i18n/fr.json @@ -40,4 +40,4 @@ "WelcomeRegister": "Bienvenue {email}, merci pour vous être enregistré.", "version": "version", "versionShortcut": "v" -} +} \ No newline at end of file diff --git a/src/i18n/zh-cn.json b/src/i18n/zh-CN.json similarity index 99% rename from src/i18n/zh-cn.json rename to src/i18n/zh-CN.json index cba6e11..357cd45 100644 --- a/src/i18n/zh-cn.json +++ b/src/i18n/zh-CN.json @@ -40,4 +40,4 @@ "WelcomeRegister": "欢迎 {email},谢谢您的注册。", "version": "版本", "versionShortcut": "v" -} +} \ No newline at end of file diff --git a/src/i18n/zh.json b/src/i18n/zh.json index 011e90d..6cfaae0 100644 --- a/src/i18n/zh.json +++ b/src/i18n/zh.json @@ -40,4 +40,4 @@ "WelcomeRegister": "歡迎 {email},謝謝您的註冊。", "version": "版本", "versionShortcut": "v" -} +} \ No newline at end of file diff --git a/src/main.js b/src/main.js index fcb6ce0..b9a2585 100644 --- a/src/main.js +++ b/src/main.js @@ -7,7 +7,7 @@ import Polyglot from 'vue-polyglot'; Vue.use(Polyglot, { defaultLanguage: 'en', - languagesAvailable: ['fr', 'es', 'de'] + languagesAvailable: ['fr', 'es', 'de', 'zh', 'zh-CN'] }); sync(store, router);