Since both countries use the same Portugese language, Apple has provided three language selection options in XCode:
- Portugese
- Portugese (Brazil) for Brazil.
- Portugese (Portugal) for Portugal.
That’s not what I see. I see two options on the primary list:
along with a bunch of options on the Other submenu.
What is the correct approach to add localization support for Brazil and Portugal options.
You have various options but I generally recommend that you stick with what Xcode shows on its primary list, that is,
pt
and
pt-PT
.
What language preference is supported by simple Portugese option.
There’s a fallback system in play here. Imagine your app is localised to
pt
,
pt-PT
and
pt-BR
. Here’s what you get based on the user’s preferred language:
If the user chooses Portugese (Brazil), they’ll get
pt-BR
.If the user chooses Portugese (Portugal), they’ll get
pt-PT
.If the user chooses some other flavour of Portugese (which they can’t do in the current iPhone UI), they’ll get
pt
.
If you do what I recommend above (include just
pt
and
pt-PT
), here’s what you get:
If the user chooses Portugese (Portugal), they’ll get
pt-PT
.If the user chooses some other flavour of Portugese (which they can’t do in the current iPhone UI), they’ll get
pt
.
In short, Brazilian Portugese essentially becomes the default.
It’s arguable whether that’s correct—of the ‘not Brazil or Portugal’ locations, there’s a good mix of those whose background is from Portugal directly and those whose background is via Brazil—but it has the advantage of being consistent with the rest of the OS.
Finally, these subtleties don’t just affect Portugese. Modern versions of iOS ship with language variants for other languages as well, the most notable being English and Chinese.
Share and Enjoy
—
Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"