96fcb9ab5e
Rework .agents/, Claude/Codex config, CI workflows, lint gates and lint-rule tests, and the release/changelog tooling. The 5% comment density gate stays diff-scoped inside git hooks, where GIT_DIR outranks the -C the gate uses to locate the repository. The tray icon generator writes multi-size ICO files from the SVG sources into the per-platform tray asset directories. The custom code-review subagents are gone: the built-in /code-review never dispatched them, and the subagent model now lives in a user-level setting outside the repository. The Makefile, build_config.yaml and CI hand the Core and Helper builds to the setup build hook, so the buildkit launchers go, and setup.dart packages AppImage and rpm on arm64 with flutter_distributor pinned to the fork tag that normalizes packaging permissions. Changelog: skip
1.7 KiB
1.7 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
-
Confirm
pubspec.yamlstill usesflutter_intl, source ARBs underarb/, and generated output underlib/l10n/. -
Scan user-facing Dart text before opening many files:
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.arb
-
Replace inline strings with existing project accessors:
- Widgets with
BuildContext:context.appLocalizations.keyfromcommon.dart. - Controllers/providers/non-widget code:
currentAppLocalizations.keyfromapp_localizations.dart.
- Widgets with
-
Regenerate:
dart run intl_utils:generate -
Verify changed Dart files with
flutter analyzewhen practical. -
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. - If generator or analyzer hits local cache permission friction, rerun serially before treating it as a code issue.