Skip to content

Go Chinese 添加中文界面 #1886

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions client/components/Nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,16 @@ class Nav extends React.PureComponent {
हिन्दी
</button>
</li>
<li className="nav__dropdown-item">
<button
onFocus={this.handleFocusForLang}
onBlur={this.handleBlur}
value="zh-CN"
onClick={(e) => this.handleLangSelection(e)}
>
简体中文
</button>
</li>
<li className="nav__dropdown-item">
<button
onFocus={this.handleFocusForLang}
Expand Down
11 changes: 7 additions & 4 deletions client/i18n.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import Backend from 'i18next-http-backend';
import { enUS, es, ja, hi, ptBR, de, frCA } from 'date-fns/locale';
import { enUS, es, ja, hi, ptBR, de, frCA, zhCN } from 'date-fns/locale';

const fallbackLng = ['en-US'];
const availableLanguages = [
Expand All @@ -11,7 +11,8 @@ const availableLanguages = [
'fr-CA',
'hi',
'ja',
'pt-BR'
'pt-BR',
'zh-CN'
];

export function languageKeyToLabel(lang) {
Expand All @@ -22,7 +23,8 @@ export function languageKeyToLabel(lang) {
'fr-CA': 'Français',
hi: 'हिन्दी',
ja: '日本語',
'pt-BR': 'Português'
'pt-BR': 'Português',
'zh-CN': '简体中文'
};
return languageMap[lang];
}
Expand All @@ -35,7 +37,8 @@ export function languageKeyToDateLocale(lang) {
'fr-CA': frCA,
hi,
ja,
'pt-BR': ptBR
'pt-BR': ptBR,
'zh-CN': zhCN
};
return languageMap[lang];
}
Expand Down
Loading