Does iOS fall back on another regional localized string?

527 views Asked by At

An iOS app has a Localizable.strings file for a language with region, es-MX (Spanish-Mexico), but no general localization file for that language, e.g. es (Spanish).

Will users with device locale es-PE (Spanish-Peru) see the es-MX translation or will it fall back to the base language en?

1

There are 1 answers

0
Manuel On BEST ANSWER

I tried it out on the simulator with iOS 10.3 and the result is:

If an es-MX translation exists, but no es translation, then the Localizeable.strings for a user with locale es-PE fall back to the base language, in my case en.

If anyone has a reference to the docs please comment and I will add it to the answer. Because if the behaviour is currently not defined it may change for future iOS versions or it may even depend on the language and region. There are regions that would qualify as "parent" for other regions, e.g. es-419 (Spanish Latin America) for es-MX (Spanish-Mexico), so it would be interesting how the fallback behaviour is defined.

However since es-419 is a distinct language one can choose in the iOS settings I assume the fallback hierarchy is:

base
↑
|- es
   ↑
   |- es-MX
   |- es-PE
   |- es-419
   |- es-ES