-
Notifications
You must be signed in to change notification settings - Fork 0
Localization
aiserrock edited this page Jul 8, 2026
·
1 revision
acits_flutter uses easy_localization for all in-app text.
- Translation files:
assets/translations/en.json,assets/translations/ru.json - Both locales are kept complete — every key must exist in both files.
- Fallback locale: ru
- Generated keys:
lib/generated/locale_keys.g.dart(LocaleKeysclass)
- No hardcoded UI strings. Any user-facing text must come from
LocaleKeys+.tr(). - Add new strings to both
en.jsonandru.jsonbefore regenerating keys. - Never edit
locale_keys.g.dartby hand — it's generated.
- Add the key/value to
assets/translations/en.jsonandassets/translations/ru.json. - Regenerate
LocaleKeys:
fvm dart run easy_localization:generate -S assets/translations -O lib/generated -o locale_keys.g.dart -f keys- Use the generated key in code:
Text(LocaleKeys.someKey.tr())- Run the regen command after every translation file change, and commit the updated
locale_keys.g.dartalongside it. - CI/reviewers should reject PRs with hardcoded strings or mismatched keys between
en.jsonandru.json.