From 02970749844c6a57f88db0484dde5c7308f62269 Mon Sep 17 00:00:00 2001 From: xatier Date: Thu, 24 Dec 2020 01:30:46 -0800 Subject: [PATCH] Add Traditional Chinese in i18n --- spec/config/i18n.spec.ts | 2 +- src/config/i18n.ts | 4 ++++ src/constants/language/index.js | 4 ++++ src/renderer/components/Preferences/Language.vue | 3 ++- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/spec/config/i18n.spec.ts b/spec/config/i18n.spec.ts index f926f6f9..f4cbcaa0 100644 --- a/spec/config/i18n.spec.ts +++ b/spec/config/i18n.spec.ts @@ -2,7 +2,7 @@ import * as path from 'path' import fs from 'fs' import keys from 'all-object-keys' -const locales = ['de', 'fr', 'it', 'ja', 'ko', 'pl', 'zh_cn'] +const locales = ['de', 'fr', 'it', 'ja', 'ko', 'pl', 'zh_cn', 'zh_tw'] describe('i18n', () => { describe('should not define duplicate keys', () => { diff --git a/src/config/i18n.ts b/src/config/i18n.ts index 683ea76f..bee3ea6d 100644 --- a/src/config/i18n.ts +++ b/src/config/i18n.ts @@ -14,6 +14,7 @@ import ru from '~/src/config/locales/ru/translation.json' import sv_se from '~/src/config/locales/sv_se/translation.json' import tzm from '~/src/config/locales/tzm/translation.json' import zh_cn from '~/src/config/locales/zh_cn/translation.json' +import zh_tw from '~/src/config/locales/zh_tw/translation.json' const options: InitOptions = { initImmediate: false, @@ -65,6 +66,9 @@ const options: InitOptions = { }, zh_cn: { translation: zh_cn + }, + zh_tw: { + translation: zh_tw } } } diff --git a/src/constants/language/index.js b/src/constants/language/index.js index 70faf19b..1ae5b1e3 100644 --- a/src/constants/language/index.js +++ b/src/constants/language/index.js @@ -31,6 +31,10 @@ export default { name: '简体中文', key: 'zh_cn' }, + zh_tw: { + name: '繁體中文', + key: 'zh_tw' + }, cs: { name: 'čeština', key: 'cs' diff --git a/src/renderer/components/Preferences/Language.vue b/src/renderer/components/Preferences/Language.vue index 63806b15..0b23817b 100644 --- a/src/renderer/components/Preferences/Language.vue +++ b/src/renderer/components/Preferences/Language.vue @@ -34,7 +34,8 @@ export default { Language.ru, Language.sv_se, Language.tzm, - Language.zh_cn + Language.zh_cn, + Language.zh_tw ] } },