Documentation menu

Languages

The kit ships in English, Arabic, Indonesian and Spanish. Arabic is right to left. The apps follow the phone's language, and users can pick another one in Profile → Language. The API answers in the same language: error messages, notifications, emails and catalog names.

The Spanish, Indonesian and Arabic texts are a careful first translation. Have a native speaker review them before launch, especially Arabic.

Turn languages on or off

Admin → Settings → Languages

  • Enabled languages: the ones the apps offer and the API answers in.
  • Default language: used when the phone's language isn't enabled.
  • Arabic-Indic digits in Arabic: show ١٢٣ instead of 123 for numbers, prices and dates.
  • Text overrides: change any app text per language without a new app release. Use the message's key from mobile/lib/core/l10n/arb/app_en.arb, e.g. homeTitle. Apps pick up changes the next time the language loads, and keep them offline. Placeholders such as {name} work in overrides. The few messages with plural or select rules ({count, plural, …}) can't be overridden; change those in the ARB files.

Catalog content (categories, services, presets) and content pages (terms, privacy, FAQ) have a field per language in the admin.

Add a new language

Example: French (fr).

1. App texts

  1. Copy mobile/lib/core/l10n/arb/app_es.arb to app_fr.arb, set "@@locale": "fr", and translate every value.

    • Keep {placeholders} and the structure of {count, plural, …} and {x, select, …} messages exactly as they are. Translate only the text inside them.
    • Use the descriptions in app_en.arb (@key entries) for context.
  2. Check and generate:

    cd mobile
    node tool/check_arb.js            # every key present, same placeholders
    flutter gen-l10n
    node tool/gen_l10n_overrides.js   # keeps admin overrides working for new keys
    dart format lib/core/l10n/gen
    
  3. Right-to-left languages (Hebrew, Persian, Urdu) need nothing else: Flutter mirrors the layout. Run the Arabic golden tests as a reference: flutter test --tags golden.

CI runs the same check, so a missing key or a stale generated file fails the build.

2. API texts

  1. Copy every file in backend/lang/es/ to backend/lang/fr/ and translate the values. Keep the keys, the :placeholders and the | plural forms.
  2. Copy backend/lang/es.json to backend/lang/fr.json and translate it (validation summary lines).
  3. Run vendor/bin/pest tests/Unit/LangParityTest.php and add fr to its list of languages. The test fails if a file or key is missing.

3. Enable it

The language code must be in SettingsSchema::SUPPORTED_LANGUAGES (fr already is). Then tick it in Admin → Settings → Languages, and fill in the French names for your categories and services in the catalog.

How it works

  • App: Flutter gen-l10n builds AppLocalizations from the ARB files. AppLocalizationsWithOverrides (generated by tool/gen_l10n_overrides.js) puts the admin's overrides on top. TranslationOverrides fetches GET /config/translations?lang=xx and caches the result.
  • Formats: dates, numbers and money go through intl with the current language. With Arabic-Indic digits on, the formatting locale is ar_EG.
  • API: the Accept-Language header picks the language (first two letters, only enabled ones), and responses carry Content-Language. Notifications and emails use the user's language.