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
The five locale catalogs contain 154 messages, including authentication,
settings, role labels, resource fields, statuses, pagination, validation, and
CRUD feedback. Sample dashboard and app content still contains English.
CI checks complete keys and matching placeholders with
python3 tools/check-l10n.py.
Formatting
KiteFormat wraps intl for money and counts. It
supports explicit locale and currency parameters. Translating display labels
does not change resource keys or status values sent to the backend.
KiteFormat.money(1264.55) // $1,264.55
KiteFormat.money(1264.55, locale: 'fr', currency: 'EUR')
KiteFormat.count(3412, locale: 'ja')
Accessibility checks
test/accessibility_test.dart checks sign-in labels, target sizes,
contrast, keyboard submission and error announcements, all action variants
across six theme combinations, plus auth and settings
layout at 200% text size in all five locales. UI-package tests also check input
values and placeholders are vertically centered at normal and large text sizes
in both text directions. Include screen-reader testing on
your target devices before release; these automated checks are not a full audit.