Localisation
Five locales, right-to-left, and the widgets that keep layout honest.
What ships
English, Spanish, French, Japanese and Arabic. Sources are
lib/l10n/app_*.arb; the generated Dart lands in
lib/l10n/ and is committed, so the repo builds without an extra
step.
flutter gen-l10n
Using a string
final l = L.of(context);
Text(l.actionSave);
Text(l.pageOf(page, pages)); // placeholders are typed
Adding a string
- Add the key to
lib/l10n/app_en.arb, with an@keyentry if it takes placeholders. - Add it to the other four
.arbfiles. - Run
flutter gen-l10n.
Adding a locale
- Copy
app_en.arbtoapp_<code>.arband translate. - Add a case to
KiteLocaleinlib/core/l10n/locale_controller.dart, with its native name — the picker shows native names, since someone looking for their language is not reading English. - Run
flutter gen-l10n.
Right-to-left
Arabic is included on purpose. It is the cheapest way to keep the layout honest — a UI that has never rendered right-to-left is usually full of hard-coded left padding nobody noticed.
Switching Kite to Arabic the first time exposed exactly that: every
Align, padding and border in the app was LTR-literal.
Use the directional variants in anything you add:
| Instead of | Use |
|---|---|
Alignment.topLeft | AlignmentDirectional.topStart |
Alignment.centerLeft | AlignmentDirectional.centerStart |
EdgeInsets.only(left:) | EdgeInsetsDirectional.only(start:) |
Border(right:) | BorderDirectional(end:) |
Positioned(right:) | PositionedDirectional(end:) |
Row, Padding.symmetric and Expanded are
already direction-aware. The trap is only the ones naming a physical side.
Coverage
Honestly stated: navigation, shell chrome, settings and the auth strings are localised. Screen bodies still hold English literals — the infrastructure and the pattern are in place, and extraction from here is mechanical rather than design work.
Formatting
KiteFormat wraps intl for money and counts. It
currently pins a symbol; for a multi-currency app, pass the locale through
and let NumberFormat.currency resolve it.
KiteFormat.money(1264.55) // $1,264.55
KiteFormat.count(3412) // 3,412