● Set up · 9 languages
Translations
nine languages, one template.
The app ships in English, German, Spanish, French, Portuguese, Arabic (right to left), Hindi, Indonesian and Turkish. Add or edit a language in one file.
01Where the texts are
- App texts:
app/lib/l10n/app_<lang>.arb.app_en.arbis the template (app/l10n.yaml). Flutter generates the Dart code automatically (generate: trueinpubspec.yaml) the next time you run or build. - Server texts (push messages, the automatic summaries):
firebase/functions/src/api/i18n.ts. - Widget texts:
values-<lang>/sm_widget_strings.xmlon Android and the<lang>.lprojfolders ofStockMasterWidgeton iOS. Indonesian isvalues-inon Android.
02Change a text
- Edit the
.arbfileChange the value; keep the{placeholders}. - Run
flutter pub getthen run or build the app. - Run the parity test
flutter test test/l10n_parity_test.dartchecks that every language has every key and placeholder.
03Add a language
- Copy
app_en.arbtoapp_<code>.arb, set"@@locale"and translate every value. - Add the language to
APP_LANGSinfirebase/functions/src/api/defaults.ts, then ini18n.tsadd a text dictionary for it and an entry inLOCALES, so the server answers in it. Add widget strings for Android and iOS too. - Check Arabic-style layouts if the language is right to left; the app mirrors its layout automatically.
Review machine translations
Have a native speaker read finance wording, labels and the disclaimer before you publish in a language.