Internationalization & Localization
Prepare the app for multiple languages, regions, number and date formats, and right-to-left layouts, then translate it.
Intermediate · about 4 hours · difficulty 2/5
Learn first: Components, Props & Styling
Most app installs come from outside English-speaking countries. Internationalization (i18n) is engineering the app so it can adapt; localization (l10n) is actually adapting it for a locale.
Externalise every string
Never hardcode user-facing text. Keep strings in resource files keyed by id:
- React Native / Expo:
i18nextwithreact-i18next, orexpo-localizationplus a library likei18n-js, with JSON files per locale. - Flutter: ARB files and
flutter gen-l10n, used viaAppLocalizations.of(context). - Android:
res/values-<lang>/strings.xmlandstringResource(R.string.title). - iOS: String Catalogs (
.xcstrings) withString(localized:).
Plurals and variables
Languages have different plural rules (Arabic has six forms). Use ICU message format or platform plural resources instead of concatenating: {count, plural, one {# item} other {# items}}.
Formats
Format dates, numbers, currencies and units with locale-aware APIs (Intl in JavaScript, intl in Dart, NumberFormat and DateTimeFormatter natively). Never build "MM/DD" strings by hand.
Right-to-left and text expansion
Arabic, Hebrew and Urdu read right to left. Use start and end instead of left and right in layouts, and mirror directional icons. German and Finnish strings can be 30 to 40 percent longer than English, so avoid fixed-width buttons.
Process
Use a translation management tool (Crowdin, Lokalise, Weblate) synced from CI, provide context screenshots to translators, and test with a pseudo-locale that lengthens and accents text.
Good enough to move on: your app runs fully in a second language, including one right-to-left locale, with correct plurals and date formats.
Key concepts
- i18n vs l10n
- String resource files
- Plurals and ICU messages
- Locale-aware dates and numbers
- Right-to-left layouts
- Text expansion and pseudo-locales
- Translation management tools
Mini project
Localise a small app into two languages including Arabic or Hebrew, with plural-aware strings, localised dates and currency, and a mirrored layout.
Check yourself
Why is building a message with string concatenation like count + " items" a problem for translation?
Free resources
- Expo: Localization (Expo)
- Flutter: Internationalizing Flutter apps (Flutter)
- Android: Localize your app (Android Developers)