-
Notifications
You must be signed in to change notification settings - Fork 0
Localization
github-actions[bot] edited this page Jul 2, 2026
·
1 revision
ChuckleChest supports multiple languages using Flutter's built-in gen_l10n
tooling and ARB files.
| Locale | Language |
|---|---|
en |
English |
de |
German |
Localization is split across two packages to match the layered architecture:
| Package | Class | Scope |
|---|---|---|
app/ |
CAppL10n |
UI strings — page titles, buttons, messages |
ccore |
CCoreL10n |
Shared strings — role names, date/number formatting |
Each has its own ARB files and generated output.
app/lib/localization/arb/
├── intl_en.arb -- English (template)
└── intl_de.arb -- German
packages/core/lib/src/localization/arb/
├── intl_en.arb -- English (template)
└── intl_de.arb -- German
English (intl_en.arb) is the template file in both packages.
- Add the key and English value to
intl_en.arb(anywhere will do, the file will be automatically sorted later) - Add the translation to
intl_de.arb - Run
hobnob dart:localizeto regenerate - Use in code via the context extensions
Keys use pageName_component_detail format:
"editGemPage_addQuoteButton": "Add a quote"
"createChestPage_hint_chestName": "Chest name"
"collectionView_noGemsTitle": "No gems to show"Generic keys shared across pages use short names: cancel, delete, close.
Access strings via context extensions:
// App strings
context.cAppL10n.editGemPage_addQuoteButton
// Core strings (roles, formatting)
context.cCoreL10n.userRole_ownerARB files support typed placeholders with ICU syntax:
"changeAvatarPage_title": "Change photo for {year}",
"@changeAvatarPage_title": {
"placeholders": {
"year": { "type": "int" }
}
}context.cAppL10n.changeAvatarPage_title(2024)ccore provides locale-aware formatting extensions:
// Date formatting
myDate.cLocalize(context, dateFormat: CDateFormat.yearMonth)
// Number formatting
myNumber.cLocalize(context, decimalDigits: 2)
// Parse localized number string
"1.234,56".cToLocalizedNum(context)- Create
intl_{locale}.arbin bothapp/andccoreARB directories - Translate all keys from
intl_en.arb - Add the
Localeto thesupportedLocaleslist inapp.dart - Run
hobnob dart:localize
See also: Architecture · Hobnob