Add a Flutter and Docusaurus Locale
Treat a locale as an end-to-end product capability, not merely a translated ARB
file. Preserve message contracts and wire the locale through app runtime,
platform metadata, manual routing, screenshots, tests, and release validation.
Build the locale inventory
- Read repository instructions and localization/manual contributor guides.
- Identify the canonical ARB, all locale ARBs,
l10n.yaml, generation and
sorting commands, localization access conventions, and missing-translation
report.
- Find every locale allowlist: app delegates/controllers, settings UI, native
platform metadata, Docusaurus config, screenshot registries, CI matrices,
and documentation.
- Inspect one recently added locale in version history as a completeness map,
but verify every location against current code.
- Read references/end-to-end-checklist.md
for platform and manual integration surfaces.
Translate the Flutter catalog
- Copy the complete key set from the canonical ARB, including required
metadata and
@@locale conventions.
- Translate user-visible messages in context. Preserve ICU syntax, placeholder
names, escaping, line breaks with semantic meaning, and product names.
- Use the project's tone and register. Keep terminology consistent across
related screens; inspect call sites when a source message is ambiguous.
- Do not translate internal identifiers, URLs, format skeletons, or values the
framework treats as syntax.
- Add locale-specific canonical metadata only where the generator or project
requires it.
- Run the generator and catalog sorter. Never hand-edit generated Dart files.
Wire the app and platforms
- Add the locale to runtime choices and language-override state.
- Update visible language names using localized strings where the UI requires
them.
- Add native supported-language declarations for every shipped platform that
maintains an explicit list.
- Update screenshot locale helpers and deterministic visible fixture copy.
- Add behavior-focused tests for locale parsing, selection, persistence,
delegates, and any locale-specific formatting or fallback behavior.
Do not infer that generated supportedLocales completes native registration.
Translate and wire the Docusaurus manual
- Add the locale to Docusaurus
i18n.localeConfigs, navigation labels, footer
labels, and any search or routing configuration.
- Create the standard docs plugin translation files and a complete localized
page tree matching the canonical docs paths.
- Reuse terms from the target ARB for buttons, settings, statuses, and feature
names. Translate the surrounding explanation naturally.
- Preserve MDX imports, components, props, links, code, identifiers, and
screenshot case IDs.
- Add the locale to screenshot registries and produce every required theme and
viewport variant using the project's deterministic harness.
- Update contributor documentation and public language lists that users see.
Audit and validate
Run the bundled contract audit before project-specific generation:
python3 <skill-dir>/scripts/audit_locale.py \
--template-arb path/to/app_en.arb \
--target-arb path/to/app_xx.arb \
--source-docs path/to/docs \
--target-docs path/to/i18n/xx/docusaurus-plugin-content-docs/current
The audit fails on missing/extra ARB keys, placeholder drift, and manual page
path mismatch. Identical translated page bodies are warnings unless
--fail-identical is passed.
Then run, in repository order:
- localization generation and ARB sorting;
- targeted localization, locale-selection, screenshot-helper, and manual tests;
- formatter and static analysis with zero diagnostics;
- the full manual typecheck, validation, tests, production build, and smoke test;
- focused Flutter tests required by the repository;
- rendered review of representative long strings and every translated manual
route.
Do not report the locale complete while generated output is stale, translation
gaps remain, or required checks fail.
1---2name: add-flutter-docusaurus-locale3description: Add, complete, or audit a locale across a Flutter application's ARB catalogs and a localized Docusaurus manual, including generated localization code, locale selectors, native platform declarations, translated MDX, screenshot fixtures, tests, and parity validation. Use when introducing a new language, finishing an incomplete app or manual translation, aligning manual terminology with UI strings, or reviewing whether a locale is production-ready end to end.4---56# Add a Flutter and Docusaurus Locale78Treat a locale as an end-to-end product capability, not merely a translated ARB9file. Preserve message contracts and wire the locale through app runtime,10platform metadata, manual routing, screenshots, tests, and release validation.1112## Build the locale inventory13141. Read repository instructions and localization/manual contributor guides.152. Identify the canonical ARB, all locale ARBs, `l10n.yaml`, generation and16 sorting commands, localization access conventions, and missing-translation17 report.183. Find every locale allowlist: app delegates/controllers, settings UI, native19 platform metadata, Docusaurus config, screenshot registries, CI matrices,20 and documentation.214. Inspect one recently added locale in version history as a completeness map,22 but verify every location against current code.235. Read [references/end-to-end-checklist.md](references/end-to-end-checklist.md)24 for platform and manual integration surfaces.2526## Translate the Flutter catalog27281. Copy the complete key set from the canonical ARB, including required29 metadata and `@@locale` conventions.302. Translate user-visible messages in context. Preserve ICU syntax, placeholder31 names, escaping, line breaks with semantic meaning, and product names.323. Use the project's tone and register. Keep terminology consistent across33 related screens; inspect call sites when a source message is ambiguous.344. Do not translate internal identifiers, URLs, format skeletons, or values the35 framework treats as syntax.365. Add locale-specific canonical metadata only where the generator or project37 requires it.386. Run the generator and catalog sorter. Never hand-edit generated Dart files.3940## Wire the app and platforms4142- Add the locale to runtime choices and language-override state.43- Update visible language names using localized strings where the UI requires44 them.45- Add native supported-language declarations for every shipped platform that46 maintains an explicit list.47- Update screenshot locale helpers and deterministic visible fixture copy.48- Add behavior-focused tests for locale parsing, selection, persistence,49 delegates, and any locale-specific formatting or fallback behavior.5051Do not infer that generated `supportedLocales` completes native registration.5253## Translate and wire the Docusaurus manual54551. Add the locale to Docusaurus `i18n.localeConfigs`, navigation labels, footer56 labels, and any search or routing configuration.572. Create the standard docs plugin translation files and a complete localized58 page tree matching the canonical docs paths.593. Reuse terms from the target ARB for buttons, settings, statuses, and feature60 names. Translate the surrounding explanation naturally.614. Preserve MDX imports, components, props, links, code, identifiers, and62 screenshot case IDs.635. Add the locale to screenshot registries and produce every required theme and64 viewport variant using the project's deterministic harness.656. Update contributor documentation and public language lists that users see.6667## Audit and validate6869Run the bundled contract audit before project-specific generation:7071```bash72python3 <skill-dir>/scripts/audit_locale.py \73 --template-arb path/to/app_en.arb \74 --target-arb path/to/app_xx.arb \75 --source-docs path/to/docs \76 --target-docs path/to/i18n/xx/docusaurus-plugin-content-docs/current77```7879The audit fails on missing/extra ARB keys, placeholder drift, and manual page80path mismatch. Identical translated page bodies are warnings unless81`--fail-identical` is passed.8283Then run, in repository order:84851. localization generation and ARB sorting;862. targeted localization, locale-selection, screenshot-helper, and manual tests;873. formatter and static analysis with zero diagnostics;884. the full manual typecheck, validation, tests, production build, and smoke test;895. focused Flutter tests required by the repository;906. rendered review of representative long strings and every translated manual91 route.9293Do not report the locale complete while generated output is stale, translation94gaps remain, or required checks fail.