Why does NSBundle return only the first localization present in the bundle, which matches the preferences of the user language, and not all matches?

Given the localization directories returned - [NSBundle localizations]

(en, es, it, nl)

and language preferences set by the user as returned - [NSLocale preferredLanguages]

(en, es, nl, ja, fr, de, it, pt-PT, sv, nb, fi, zh-hans, zh-hant, ko)

I expect all four available localizations to be returned in the preferred language order - [NSBundle preferredLocalizationsFromArray:] (or -preferredLocalizations or -preferredLocalizationsFromArray: forPreferences :).

Instead, -preferredLocalizationsFromArray: returns only "en" as a viable source of localized resources.

Why?

+3
2

preferredLocalizationsFromArray:

, .

, , .

, .

+1

iOS 10 - . , , .

, "pt" "pt-BR" , "pt-BR" , [[NSBundle mainBundle] preferredLocalizations] ("pt-BR","pt"), "pt", "pt-BR" .

0

All Articles