Closed xkww3n closed 1 year ago
Flutter localization requires a default localization file without script code so i used app_zh_hans as the default and created app_zh.arb.
if you try generating the dart localization files using the command flutter gen-l10n
it will through the following error with your code.
Because l10n.yaml exists, the options defined there will be used instead.
To use the command line arguments, delete the l10n.yaml file in the Flutter project.
Arb file for a fallback, zh, does not exist, even though
the following locale(s) exist: [zh_Hans, zh_Hant].
When locales specify a script code or country code, a
base locale (without the script code or country code) should
exist as the fallback. Please create a {fileName}_zh.arb
file.
so please update PR by restoring app_zh.arb file
Flutter localization requires a default localization file without script code so i used app_zh_hans as the default and created app_zh.arb.
if you try generating the dart localization files using the command
flutter gen-l10n
it will through the following error with your code.Because l10n.yaml exists, the options defined there will be used instead. To use the command line arguments, delete the l10n.yaml file in the Flutter project. Arb file for a fallback, zh, does not exist, even though the following locale(s) exist: [zh_Hans, zh_Hant]. When locales specify a script code or country code, a base locale (without the script code or country code) should exist as the fallback. Please create a {fileName}_zh.arb file.
so please update PR by restoring app_zh.arb file
Thanks for pointing out the problem. I've restored the file and now flutter gen-l10n
comes with no error.
lib/src/l10n/app_zh.arb
currently contains Simplified Chinese translation. I merged it intolib/src/l10n/app_zh_Hans.arb
which specify the simplified variant exactly. I also change the 4 Chinese variants' names inlib/src/constants/language_list.dart
to follow the naming convention.