ARB
Application Resource Bundle (ARB) is a file format for managing localized text strings in applications, particularly in Flutter development. The format is JSON-based but differs in structure and additional information from Lingohub's standard JSON implementation since ARB files can include additional metadata for context, description, and other attributes.
Format
- The file extension is
.arb
- A segment is defined as for JSON as a key-value pair
- Additional attributes for a segment can be defined by an additional attribute
"@<key of corresponding segment>": {<holds object defining attributes like type, context, description, placeholder information >}
- Such information will be stored at import to be exported again
- Placeholder syntax is
{<name>}
- Plurals are supported by ICU placeholder syntax.
- Attributes like
@@last_modified
&@@locale
will be set at export - Global attributes starting with
@@
and custom attributes starting withx-
will be exported as imported
Examples
{
"@@last_modified": "2021-02-15T09:58:36.312610",
"@@locale": "en_US",
"title_bar": "My Cool Home",
"@title_bar": {
"type": "text",
"context": "HomePage",
"description": "Page title."
},
"okMessage": "Everything works fine.",
"pendingCosts": "Your pending cost is {COST}",
"@pendingCosts": {
"type": "currency",
"context": "HomePage:MainPanel",
"description": "balance statement.",
"placeholders": {
"COST": {
"example": "$123.45",
"description": "cost presented with currency symbol"
}
}
},
"pageHomeInboxCount": "{count, plural, one{You have 1 new message} other{You have {count} new messages}}",
"@pageHomeInboxCount": {
"context": "New messages count on the Home screen",
"placeholders": {
"count": {}
}
}
References
Updated 17 days ago