From d83a03d1a7074c64b4e5b5359c57a5bab2dceb24 Mon Sep 17 00:00:00 2001 From: dchenmei Date: Sat, 27 Oct 2018 11:45:39 -0400 Subject: [PATCH 1/2] Added chinese translation --- src/index.js | 3 ++- src/messages.js | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index cf04172..8e0f269 100644 --- a/src/index.js +++ b/src/index.js @@ -11,6 +11,7 @@ import fr from 'react-intl/locale-data/fr'; // French import es from 'react-intl/locale-data/es'; // Spanish import sv from 'react-intl/locale-data/sv'; // Swedish import no from 'react-intl/locale-data/no'; // Norwegian +import zh from 'react-intl/locale-data/zh'; // Chinese // ... and so on import { flattenMessages } from './js/utils'; // flatten messages util function in order to use nested js object for translated texts @@ -22,7 +23,7 @@ require('moment/locale/fr'); require('moment/locale/sv'); require('moment/locale/no'); -addLocaleData([...en, ...de, ...fr, ...es, ...sv, ...no]); // don't forget to add here and spread whatever language that was added ex: ...it +addLocaleData([...en, ...de, ...fr, ...es, ...sv, ...no, ...zh]); // don't forget to add here and spread whatever language that was added ex: ...it // constants const sDefaultLocale = "en"; // could be changed diff --git a/src/messages.js b/src/messages.js index 542b298..030fd5f 100644 --- a/src/messages.js +++ b/src/messages.js @@ -72,6 +72,19 @@ export default { UsernameWarning: "Vennligst skriv inn brukernavn.", PasswordWarning: "Vennligst skriv inn passord." } + }, + zh: { + LoginScreen: { + Hibernate: "休眠", + Suspend: "暂停", + Restart: "重启", + Shutdown: "关闭", + Lock: "锁", + UserPlaceholder: "用户名", + PasswordPlaceholder: "密码", + UsernameWarning: "请输入您的用户名.", + PasswordWarning: "请输入您的密码." + } } }; From c5357f5867cf516390742ada6cad143020573983 Mon Sep 17 00:00:00 2001 From: dchenmei Date: Sun, 28 Oct 2018 11:58:51 -0400 Subject: [PATCH 2/2] added moment.js locale --- src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.js b/src/index.js index 8e0f269..9f66e99 100644 --- a/src/index.js +++ b/src/index.js @@ -22,6 +22,7 @@ require('moment/locale/de'); require('moment/locale/fr'); require('moment/locale/sv'); require('moment/locale/no'); +require('moment/locale/zh'); addLocaleData([...en, ...de, ...fr, ...es, ...sv, ...no, ...zh]); // don't forget to add here and spread whatever language that was added ex: ...it