How do you implement internationalization in Android applications?

Instruction: Describe the steps to support multiple languages in an Android app.

Context: This question tests the candidate's knowledge of Android's internationalization capabilities. Candidates should discuss using the `res/values` directory for storing localized strings and other resources, and how Android automatically applies resources matching the device's locale. Mention of best practices for managing language preferences and dynamically updating the app's locale can also be relevant.

Updated

Official answer

Externalize user-visible strings and locale-sensitive resources. Keep a complete default set in res/values, then add appropriate language/region resources such as values-es. Use parameterized full phrases and plural resources instead of concatenating translated fragments or assuming every language has singular/plural only. Format dates, numbers and currency with the intended locale, currency and timezone semantics.

Support right-to-left layouts using start/end concepts and suitable RTL configuration, while checking which icons/content should mirror. Test text expansion, font scaling, long names and bidirectional text. Translation does not automatically make a layout usable.

For an app language picker, use supported per-app language APIs. Android 13 provides LocaleManager and system per-app language settings; the AndroidX AppCompat path supplies compatible APIs/storage behavior for earlier supported versions. Configure the supported locale list and the appropriate persistence/migration path. Follow the Activity requirements of the chosen integration instead of mutating a global Configuration or repeatedly replacing visible labels by hand.

Changing app language normally recreates the Activity, so preserve task state and let resources reload. Provide a follow-system option and migrate an existing stored choice deliberately. Also consider localized server content and a meaningful fallback when a translation is missing.

Validate pseudo-locales, RTL, plural edge values, process restart and system-versus-in-app picker consistency with native-language review. Task success and translation defects are direct quality evidence; DAU by locale is contextual usage, not proof that translations are correct.

Localizing resources, Per-app languages, RTL support

Related Questions