Skip to content

Commit 150a59d

Browse files
authored
Merge pull request #478 from antkwok/feature/support-zh-hk-language
2 parents 900ee3c + 1648302 commit 150a59d

File tree

7 files changed

+6623
-2
lines changed

7 files changed

+6623
-2
lines changed

β€Žbackend/app/Locale.phpβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ enum Locale: string
1515
case PT = 'pt';
1616
case PT_BR = 'pt-br';
1717
case ZH_CN = 'zh-cn';
18+
19+
case ZH_HK = 'zh-hk';
1820
case VI = 'vi';
1921

2022
public static function getSupportedLocales(): array

β€Žbackend/lang/zh-hk.jsonβ€Ž

Lines changed: 423 additions & 0 deletions
Large diffs are not rendered by default.

β€Žfrontend/lingui.config.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const config: LinguiConfig = {
1717
// "ja", // Japanese
1818
// "ko", // Korean
1919
// "id", // Indonesian
20-
// "zh-hk", // Cantonese Chinese (Hong Kong)
20+
"zh-hk", // Cantonese Chinese (Hong Kong)
2121
// "cs", // Czech
2222
// "ga", // Irish
2323
],

β€Žfrontend/src/components/common/LanguageSwitcher/index.tsxβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export const LanguageSwitcher = () => {
2424
return t`Brazilian Portuguese`;
2525
case "zh-cn":
2626
return t`Chinese (Simplified)`;
27+
case "zh-hk":
28+
return t`Chinese (Traditional)`;
2729
case "vi":
2830
return t`Vietnamese`;
2931
}

β€Žfrontend/src/locales.tsβ€Ž

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ import {messages as es} from "./locales/es.po";
1111
// @ts-ignore
1212
import {messages as zhCn} from "./locales/zh-cn.po";
1313
// @ts-ignore
14+
import {messages as zhHk} from "./locales/zh-hk.po";
15+
// @ts-ignore
1416
import {messages as ptBr} from "./locales/pt-br.po";
1517
// @ts-ignore
1618
import {messages as vi} from "./locales/vi.po";
1719
import {i18n} from "@lingui/core";
1820
import {t} from "@lingui/macro";
1921

20-
export type SupportedLocales = "en" | "de" | "fr" | "pt" | "es" | "zh-cn" | "pt-br" | "vi";
22+
export type SupportedLocales = "en" | "de" | "fr" | "pt" | "es" | "zh-cn" | "zh-hk" | "pt-br" | "vi";
2123

2224
export const localeMessages: Record<string, any> = {
2325
en: en,
@@ -26,6 +28,7 @@ export const localeMessages: Record<string, any> = {
2628
pt: pt,
2729
es: es,
2830
"zh-cn": zhCn,
31+
"zh-hk": zhHk,
2932
"pt-br": ptBr,
3033
vi: vi,
3134
};
@@ -37,6 +40,7 @@ export const localeToFlagEmojiMap: Record<SupportedLocales, string> = {
3740
pt: 'πŸ‡΅πŸ‡Ή',
3841
es: 'πŸ‡ͺπŸ‡Έ',
3942
"zh-cn": 'πŸ‡¨πŸ‡³',
43+
"zh-hk": 'πŸ‡­πŸ‡°',
4044
"pt-br": 'πŸ‡§πŸ‡·',
4145
vi: 'πŸ‡»πŸ‡³',
4246
};
@@ -48,6 +52,7 @@ export const localeToNameMap: Record<SupportedLocales, string> = {
4852
pt: `Portuguese`,
4953
es: `Spanish`,
5054
"zh-cn": `Chinese`,
55+
"zh-hk": `Cantonese`,
5156
"pt-br": `Portuguese (Brazil)`,
5257
vi: `Vietnamese`,
5358
};

β€Žfrontend/src/locales/zh-hk.jsβ€Ž

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
Β (0)