From f82168c5716eee63dd559edd6e8290c98d3b6eff Mon Sep 17 00:00:00 2001 From: Guillaume Vincent Date: Thu, 30 Mar 2017 19:18:43 +0200 Subject: [PATCH] add zh-CN in the application --- package.json | 2 +- scripts/buildI18n.js | 6 +++--- src/i18n/fr.json | 2 +- src/i18n/zh-CN.json | 43 +++++++++++++++++++++++++++++++++++++++++++ src/i18n/zh-cn.json | 43 ------------------------------------------- src/i18n/zh.json | 2 +- src/main.js | 2 +- 7 files changed, 50 insertions(+), 50 deletions(-) create mode 100644 src/i18n/zh-CN.json delete mode 100644 src/i18n/zh-cn.json 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 new file mode 100644 index 0000000..357cd45 --- /dev/null +++ b/src/i18n/zh-CN.json @@ -0,0 +1,43 @@ +{ + "Advanced options": "进阶选项", + "Copied": "已复制", + "Counter": "计数器", + "CounterFieldHelp": "改变这个值,就可以在不改变主密码的状况下,产生新的密码。", + "CreatePassword": "您要产生一组密码吗?", + "DBNotRunning": "您的 LessPass 资料库并未执行", + "DefaultOptionLocalStorage": "我们将预设选项储存在本机。每当您开启程式,这些设定将会被自动载入。", + "DeleteProfileConfirm": "您确定要删除这个密码吗?", + "Email": "邮件位址", + "EmailAlreadyExist": "这个邮件位址已被注册。想要登入或取回您的密码吗?", + "EmailInvalid": "请输入一个有效的邮件位址", + "EmailRequiredError": "我们需要邮件位址来找到您的帐号。", + "Encrypt my master password": "加密我的主密码", + "EncryptMasterPassword": "在将密码传至 lesspass.com 前,请点我加密。", + "ForgotPassword": "忘记您的登入密码了吗?", + "Generate": "产生", + "Generating": "产生中", + "Length": "长度", + "Login": "登入帐号", + "LoginFormInvalid": "LessPass URL、邮件位址、登入密码皆为必填栏位。", + "LoginIncorrectError": "我们查不到您输入的邮件位址及登入密码。请确认后再试一次。", + "Master Password": "主密码", + "New Password": "新密码", + "NoMatchFor": "喔不!没有找到跟下列条件相似的结果:", + "NoPassword": "您的资料库内没有储存任何密码。", + "PasswordProfileSuccessfullyDeleted": "已成功删除您的密码。", + "PasswordResetRequired": "请输入登入密码", + "PasswordResetSuccessful": "已成功重置您的登入密码。", + "Register": "注册", + "Reset my password": "重置我的登入密码", + "ResetLinkExpired": "此登入密码重设连结已过期。", + "Save default options locally": "将设定储存在本机", + "Sign In": "登入", + "Site": "网站位址", + "SiteLoginMasterPasswordMandatory": "网站位址、登入帐号、主密码皆为必填栏位。", + "UpdateYourSearch": "请试着放宽您的搜寻条件。", + "Version": "版本", + "WarningV1": "版本 1 已不支援,并将在 {dayBeforeOnlyV2} 天内移除。我们强烈得建议您将密码换至版本 2。", + "WelcomeRegister": "欢迎 {email},谢谢您的注册。", + "version": "版本", + "versionShortcut": "v" +} \ No newline at end of file diff --git a/src/i18n/zh-cn.json b/src/i18n/zh-cn.json deleted file mode 100644 index cba6e11..0000000 --- a/src/i18n/zh-cn.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "Advanced options": "进阶选项", - "Copied": "已复制", - "Counter": "计数器", - "CounterFieldHelp": "改变这个值,就可以在不改变主密码的状况下,产生新的密码。", - "CreatePassword": "您要产生一组密码吗?", - "DBNotRunning": "您的 LessPass 资料库并未执行", - "DefaultOptionLocalStorage": "我们将预设选项储存在本机。每当您开启程式,这些设定将会被自动载入。", - "DeleteProfileConfirm": "您确定要删除这个密码吗?", - "Email": "邮件位址", - "EmailAlreadyExist": "这个邮件位址已被注册。想要登入或取回您的密码吗?", - "EmailInvalid": "请输入一个有效的邮件位址", - "EmailRequiredError": "我们需要邮件位址来找到您的帐号。", - "Encrypt my master password": "加密我的主密码", - "EncryptMasterPassword": "在将密码传至 lesspass.com 前,请点我加密。", - "ForgotPassword": "忘记您的登入密码了吗?", - "Generate": "产生", - "Generating": "产生中", - "Length": "长度", - "Login": "登入帐号", - "LoginFormInvalid": "LessPass URL、邮件位址、登入密码皆为必填栏位。", - "LoginIncorrectError": "我们查不到您输入的邮件位址及登入密码。请确认后再试一次。", - "Master Password": "主密码", - "New Password": "新密码", - "NoMatchFor": "喔不!没有找到跟下列条件相似的结果:", - "NoPassword": "您的资料库内没有储存任何密码。", - "PasswordProfileSuccessfullyDeleted": "已成功删除您的密码。", - "PasswordResetRequired": "请输入登入密码", - "PasswordResetSuccessful": "已成功重置您的登入密码。", - "Register": "注册", - "Reset my password": "重置我的登入密码", - "ResetLinkExpired": "此登入密码重设连结已过期。", - "Save default options locally": "将设定储存在本机", - "Sign In": "登入", - "Site": "网站位址", - "SiteLoginMasterPasswordMandatory": "网站位址、登入帐号、主密码皆为必填栏位。", - "UpdateYourSearch": "请试着放宽您的搜寻条件。", - "Version": "版本", - "WarningV1": "版本 1 已不支援,并将在 {dayBeforeOnlyV2} 天内移除。我们强烈得建议您将密码换至版本 2。", - "WelcomeRegister": "欢迎 {email},谢谢您的注册。", - "version": "版本", - "versionShortcut": "v" -} 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);