Suppose my app supports English and Spanish localizations to the extent that it includes en.lproj/Localizable.strings
and es.lproj/Localizable.strings
. Suppose also that it runs on an iPhone whose region is set to German.
In this case I want to display dates in English (not German) in order not to produce a user interface that is partly English (due to en.lproj/Localizable.strings
) and partly German (due to the selected region) and that may hence include "mixed" strings such as "Weekend edition, Samstag, 10.1."
.
So how can I find out programmatically from within an iOS app which localization is actually in use (e.g. English in the case of the iPhone whose region is set to Germany but where the app only supports English and Spanish localizations)?
NSLocale -preferredLanguages
then, it seems to be doing the job you want. – A-Live