Enable zh translation

This commit is contained in:
Ming Ming 2022-05-14 14:46:31 +08:00
parent d6c980c917
commit 0d34625fac
2 changed files with 14 additions and 0 deletions

View file

@ -17,6 +17,16 @@ final supportedLanguages = {
_AppLanguageEnum.systemDefault.index: AppLanguage(
_AppLanguageEnum.systemDefault.index, "System default", null, null),
// sorted by alphabetic order of their ISO language names
_AppLanguageEnum.chineseHans.index: AppLanguage(
_AppLanguageEnum.chineseHans.index,
"中文 (简体)",
"Chinese (Simplified)",
const Locale.fromSubtags(languageCode: "zh", scriptCode: "Hans")),
_AppLanguageEnum.chineseHant.index: AppLanguage(
_AppLanguageEnum.chineseHant.index,
"中文 (繁體/正體)",
"Chinese (Traditional)",
const Locale.fromSubtags(languageCode: "zh", scriptCode: "Hant")),
_AppLanguageEnum.czech.index: AppLanguage(
_AppLanguageEnum.czech.index, "čeština", "Czech", const Locale("cs")),
_AppLanguageEnum.english.index: AppLanguage(
@ -52,6 +62,8 @@ enum _AppLanguageEnum {
finnish,
polish,
portuguese,
chineseHans,
chineseHant,
}
AppLanguage _getSelectedLanguage() {

View file

@ -97,6 +97,8 @@ class _MyAppState extends State<MyApp>
Locale("fi"),
Locale("pl"),
Locale("pt"),
Locale.fromSubtags(languageCode: "zh", scriptCode: "Hans"),
Locale.fromSubtags(languageCode: "zh", scriptCode: "Hant"),
],
builder: (context, child) {
MyApp._globalContext = context;