Browse Source

add zh-CN in the application

pull/342/head
Guillaume Vincent 7 years ago
parent
commit
f82168c571
6 changed files with 8 additions and 8 deletions
  1. +1
    -1
      package.json
  2. +3
    -3
      scripts/buildI18n.js
  3. +1
    -1
      src/i18n/fr.json
  4. +1
    -1
      src/i18n/zh-CN.json
  5. +1
    -1
      src/i18n/zh.json
  6. +1
    -1
      src/main.js

+ 1
- 1
package.json View File

@@ -34,7 +34,7 @@
"lesspass": "^6.0.0", "lesspass": "^6.0.0",
"lodash.debounce": "^4.0.8", "lodash.debounce": "^4.0.8",
"vue": "^2.2.2", "vue": "^2.2.2",
"vue-polyglot": "^0.1.4",
"vue-polyglot": "^0.1.5",
"vue-router": "^2.3.0", "vue-router": "^2.3.0",
"vuex": "^2.2.1", "vuex": "^2.2.1",
"vuex-persistedstate": "^1.3.0", "vuex-persistedstate": "^1.3.0",


+ 3
- 3
scripts/buildI18n.js View File

@@ -18,7 +18,7 @@ walker.on("file", (root, fileStats, next) => {
}); });


const I18N_DIR = '../src/i18n'; 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", () => { walker.on("end", () => {
LANGUAGES_AVAILABLE.forEach(lang => { LANGUAGES_AVAILABLE.forEach(lang => {
const localeFile = path.join(I18N_DIR, `${lang}.json`); const localeFile = path.join(I18N_DIR, `${lang}.json`);
@@ -29,9 +29,9 @@ walker.on("end", () => {


const localeOrdered = {}; const localeOrdered = {};
Object.keys(locale).sort().forEach(function(key) { Object.keys(locale).sort().forEach(function(key) {
if(key in existingLocale){
if (key in existingLocale) {
localeOrdered[key] = existingLocale[key]; localeOrdered[key] = existingLocale[key];
}else{
} else {
localeOrdered[key] = locale[key]; localeOrdered[key] = locale[key];
} }
}); });


+ 1
- 1
src/i18n/fr.json View File

@@ -40,4 +40,4 @@
"WelcomeRegister": "Bienvenue {email}, merci pour vous être enregistré.", "WelcomeRegister": "Bienvenue {email}, merci pour vous être enregistré.",
"version": "version", "version": "version",
"versionShortcut": "v" "versionShortcut": "v"
}
}

src/i18n/zh-cn.json → src/i18n/zh-CN.json View File

@@ -40,4 +40,4 @@
"WelcomeRegister": "欢迎 {email},谢谢您的注册。", "WelcomeRegister": "欢迎 {email},谢谢您的注册。",
"version": "版本", "version": "版本",
"versionShortcut": "v" "versionShortcut": "v"
}
}

+ 1
- 1
src/i18n/zh.json View File

@@ -40,4 +40,4 @@
"WelcomeRegister": "歡迎 {email},謝謝您的註冊。", "WelcomeRegister": "歡迎 {email},謝謝您的註冊。",
"version": "版本", "version": "版本",
"versionShortcut": "v" "versionShortcut": "v"
}
}

+ 1
- 1
src/main.js View File

@@ -7,7 +7,7 @@ import Polyglot from 'vue-polyglot';


Vue.use(Polyglot, { Vue.use(Polyglot, {
defaultLanguage: 'en', defaultLanguage: 'en',
languagesAvailable: ['fr', 'es', 'de']
languagesAvailable: ['fr', 'es', 'de', 'zh', 'zh-CN']
}); });


sync(store, router); sync(store, router);


Loading…
Cancel
Save