Flutter Application Resource Bundles (client/lib/l10n)
The .arb
files externalize strings from the app and flutter_intl
takes care of generating the messages in
client/lib/generated/intl
Application Resource Bundle (abbr. ARB
) is a localization resource format that is simple (based on JSON
).
Read the Application Resource Bundle Specification
to find out more about the ARB
syntax and learn more about ICU
messages and play with examples,
or your own using this project on GitHub
Versions packaged in the app are not updated dynamically.
Dynamic Assets: content_bundles (client/assets/content_bundles)
The .yaml
files in this folder packaged in the app for users without internet connectivity, but the app
attempts to fetch updated versions online if available.
This means the translation of the .yaml
files doesn’t technically have to be complete for the app to be released.
.dart
files into the .arb
files..arb
& .yaml
files.API integration to come at a later stage
UTF-8
with LF
line endings.Externalize by default
Structure the content
@section
key name.Author strings with translation in mind
\n
) to structure or style text. If the element that uses the key relies on this it
‘ll most likely break the style when translated.description
, type
& placeholders
are visible to the translators in the CAT tool.{
"greetingsText": "{ gender, select, male{Dear {firstName} } female{Dear {firstName} } other{Dear {firstName} } }, this is an ICU Message example that shows gender forms.",
"@greetingsText": {
"description": "User greeting",
"type": "text",
"placeholders": {
"firstName": "Foo Bar"
}
},
"pushCounterText": "This ICU Message example that shows plural forms. {count, plural, =0{You have never pushed the button} =1{You have pushed the button once} other{You have pushed the button {pushCount} times in a row} }",
"@pushCounterText": {
"description": "A description for the push counter",
"type": "text",
"placeholders": {
"pushCount": "3"
}
},
"icuMessageFormatForTranslators": "Visit this page: <a href=\"{url}\">Online ICU Message Editor</a> to learn how to write ICU Messages with confidence.",
"@icuMessageFormatForTranslators": {
"description": "A link to Online ICU Message Editor",
"type": "url",
"placeholders": {
"url": "https://format-message.github.io/icu-message-format-for-translators/"
}
},
"notRecommendedButSupportedText": "<ul><li>apple</li><li>banana</li><li>kiwi</li></ul>",
"@notRecommendedButSupportedText": {
"description": "Shows a list of items in HTML, each item is treated as a segment in the CAT tool",
"type": "html"
}
}
Structure the content
Inform the localization manager(s) when you add new schema. File filtering configuration needs to be updated when new key names need to be added to the whitelist of keys included for translation:
title_html
body_html
title
subtitle
button_text
banner
body