Suwayomi / Tachidesk-Sorayomi

A free and open source manga reader app to read manga from a Tachidesk-Server instance.
https://suwayomi.github.io/Tachidesk-Sorayomi/
Mozilla Public License 2.0
821 stars 62 forks source link

Chinese language related cleanup. #221

Closed xkww3n closed 1 year ago

xkww3n commented 1 year ago

lib/src/l10n/app_zh.arb currently contains Simplified Chinese translation. I merged it into lib/src/l10n/app_zh_Hans.arb which specify the simplified variant exactly. I also change the 4 Chinese variants' names in lib/src/constants/language_list.dart to follow the naming convention.

DattatreyaReddy commented 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

xkww3n commented 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

Thanks for pointing out the problem. I've restored the file and now flutter gen-l10n comes with no error.