Skip to content

i18n: add Traditional Chinese (zh_TW) localization - #93

Open
monarchsofchaos004-gif wants to merge 1 commit into
fregie:masterfrom
monarchsofchaos004-gif:add-zh-tw-l10n
Open

monarchsofchaos004-gif wants to merge 1 commit into
fregie:masterfrom
monarchsofchaos004-gif:add-zh-tw-l10n

Conversation

@monarchsofchaos004-gif

Copy link
Copy Markdown

Summary

Adds a Traditional Chinese (Taiwan) localization, zh_TW, as suggested in #76.

  • New lib/l10n/app_zh_TW.arb (140 keys, same keys and order as app_zh.arb, @@locale is zh_TW). Translated from app_en.arb, using app_zh.arb as a reference, with Taiwan terminology (設定, 檔案, 相簿, 影片, 上傳, 下載, 伺服器, 網路, 儲存, 快取, 訂閱, ...). Placeholders ({count}, {price}, {percent}, {succeeded}, {failed}) are kept as-is. Punctuation is full-width (,?:), as is usual in Traditional Chinese text.
  • lib/l10n/app_localizations.dart: added Locale('zh', 'TW') to supportedLocales, and a countryCode == 'TW' branch in lookupAppLocalizations.
  • lib/l10n/app_localizations_zh.dart: added AppLocalizationsZhTw extends AppLocalizationsZh with an override for every key.
  • lib/background_sync_entrypoint.dart: the headless background-sync isolate picks the localization from Platform.localeName; it now returns AppLocalizationsZhTw for zh_TW / zh_Hant_TW and still uses AppLocalizationsZh for other zh locales, so the sync notification is also in Traditional Chinese.

Other zh locales (zh_CN, zh_HK, ...) behave as before. Date formatting in gallery_body.dart keys off languageCode == 'zh', so it applies to zh_TW unchanged.

How it was checked

A script compares app_zh_TW.arb against app_zh.arb and app_en.arb: identical key set and order, placeholders identical to the English template, no empty values, no mainland-only terms or Simplified characters, and the Dart AppLocalizationsZhTw class has exactly one override per key (140). All checks pass.

Not verified

  • I did not run flutter gen-l10n or build the app, and did not test on a device. The generated Dart files (app_localizations.dart, app_localizations_zh.dart) were updated by hand to follow the gen-l10n output format for a regional variant. If you prefer to regenerate them, please let me know or just run flutter gen-l10n; the .arb is the source of truth.
  • Translations were not reviewed on screen, so some strings may need layout or wording tweaks.

Closes #76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

可以支援繁體中文嗎?

1 participant