Localizely logo
  • Home
  • Getting started
  • How it works
  • Pricing
  • FAQ
Sign up

I18n questions

Common questions about Android localization


  • How do I change the app language programmatically on Android?

    Call `AppCompatDelegate.setApplicationLocales(LocaleListCompat.forLanguageTags("fr"))` with AppCompat 1.6.0 or newer. Android 13+ stores the choice in the system; on older versions enable `autoStoreLocales` in the manifest. The old `Configuration` and `updateConfiguration()` hacks are deprecated.

  • How do I fix the Android error "is translated here but not found in default locale"?

    It is lint's ExtraTranslation check. A string exists in a `values-xx` folder but not in the default `res/values` folder. Add the default string or delete the stray translation; if it is intentional, suppress it with `tools:ignore="ExtraTranslation"` on that string.

  • How do I get the current app or device language on Android?

    `Locale.getDefault()` returns the locale your app is running in, including a per-app language. `AppCompatDelegate.getApplicationLocales()` tells whether a per-app language is set (empty means follow the system), and on Android 13+ `LocaleManager.getSystemLocales()` gives the device language.

  • How do I ignore "is not translated in" (MissingTranslation) lint errors in Android?

    MissingTranslation is a lint check, not a compiler error, and a missing translation falls back to the default string at runtime. Mark strings `translatable="false"`, add `tools:ignore="MissingTranslation"` to one string or file, or disable the check in `lint.xml` or Gradle.

  • How do I insert a variable into a localized string in Android?

    Put positional placeholders such as `%1$s` and `%2$d` in the string resource and pass the values as format arguments to `getString()` or Compose's `stringResource()`. For counts, use quantity strings so every language gets the right plural form.

  • How do I use a percent sign in Android strings.xml?

    Write `%%` when the string is formatted with arguments through `getString(id, args)` or Compose's `stringResource(id, args)`. A string that is never formatted can keep a plain `%`; add `formatted="false"` when aapt2 warns about multiple non-positional substitutions.

  • What are the Android resource folder names for languages and regions, including Simplified and Traditional Chinese?

    Use `values-<lang>` (ISO 639-1), `values-<lang>-r<REGION>` such as `values-pt-rBR`, or the BCP 47 form `values-b+<lang>+<script>+<region>` such as `values-b+sr+Latn`. For Chinese, name folders by script, `values-b+zh+Hans` and `values-b+zh+Hant`, rather than by region.

  • What is xliff:g in Android strings.xml and when should I use it?

    The `<xliff:g>` tag marks a part of a string that translators must not change, such as a `%1$s` placeholder, a product name or a code. Declare `xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"` on `<resources>`; aapt2 drops the tag when compiling, so it costs nothing at runtime.

Localizely logo
About
Free tools
Boring stuff
  • Privacy Policy
  • Terms of Service
  • Cookie Policy
  • Compare
Newsletter
Copyrights 2026 © Localizely