Changelog: French, Spanish and Korean translations
1.9 KiB
name, description
| name | description |
|---|---|
| localization | Use when changing FlClash UI text, scanning for hardcoded Chinese strings, updating ARB localization, or fixing generated locale output in this repository. |
Localization
When To Use
Use this for localization work in this repository, especially hardcoded UI text in lib/, ARB updates, missing translations, or generated lib/l10n/ output that does not match source ARB values.
Do not use this for README translation sync or manual edits to generated localization Dart.
Workflow
-
Scan user-facing Dart text before opening many files.
flutter_intlreadsarb/and writeslib/l10n/:rg -n "[\\p{Han}]" lib -g '!lib/l10n/intl/**' -g '!lib/**/generated/**' -
Inspect the smallest relevant call sites and nearby ARB keys.
-
Add or update every source ARB:
arb/intl_en.arbarb/intl_zh_CN.arbarb/intl_ja.arbarb/intl_ru.arbarb/intl_fr.arbarb/intl_es.arbarb/intl_ko.arb
-
Replace inline strings with existing project accessors:
- Widgets with
BuildContext:context.appLocalizations.keyfromlib/common/context.dart. - Controllers/providers/non-widget code:
currentAppLocalizations.keyfromlib/common/app_localizations.dart.
- Widgets with
-
Regenerate:
dart run intl_utils:generate -
Run
flutter analyze --no-fatal-infosandflutter test test/l10n test/lint/dynamic_message_key_test.dart. The lint test checks that every locale carries the same keys and that noIntl.messagebuilds a key at runtime; labels for enum values go through the switches inlib/common/l10n_labels.dart, as the ARB section of.agents/rules.mdexplains. -
Re-run the Han-text scan for targeted strings.
Pitfalls
- If ja/ru still show English, fix ja/ru source ARB values and regenerate. Do not edit generated Dart.
- Ignore
lib/l10n/intl/**andlib/**/generated/**during text scans.