Flutter ARB
Translate ARB message values while retaining resource metadata and placeholder definitions.
An Application Resource Bundle, or ARB, keeps Flutter messages beside their descriptions and placeholder definitions. The flutter file handler translates plain string entries in this flat JSON object and preserves keys beginning with @ as metadata.
Messages and metadata #
For example, a delivery message can declare the number it receives:
{
"@@locale": "en",
"delivery": "Delivery within {days} days",
"@delivery": {
"description": "Checkout estimate for the latest arrival date",
"placeholders": {
"days": { "type": "int" }
}
}
}delivery becomes a translation unit. The sibling @delivery.description is a translator hint; it remains metadata in the output. Placeholder definitions are carried through rather than translated. The handler does not treat arbitrary nested objects as additional message catalogs.
When @@locale exists and a target locale is supplied, reconstruction updates it. An absent @@locale is not automatically added. Other bundle globals retain source values.
Existing values and scope #
The previous source identifies message changes by key. The existing target can provide accepted values. Reconstruction uses the current source's metadata, so source metadata changes can appear in the output even when message wording is reused.
Use ordinary source updates for changed messages, or a deliberate whole-file refresh after changing translation guidance; see CLI scopes. Check the resulting messages and metadata before running Flutter generation.
Output uses two-space JSON indentation and a trailing newline. This is structural reconstruction, not byte-preserved source formatting.
Translate, then generate Flutter resources #
The CLI infers flutter from .arb. A source such as app_en.arb produces per-locale files, such as app_de.arb; match these paths to the project's localization configuration. Use CLI configuration or GitHub for file selection.
After retrieval, run the project's Flutter localization generator and build checks. Render parameterized messages with real values and exercise plural cases in each target locale. The preserved metadata tells the generator what to expect; the translated message still needs to use those placeholders correctly. Localize a Flutter app carries the resources through this application check.