You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.
Sometimes, you need to know which language your app is running in. Often, people will use NSLocale +preferredLanguages. Unfortunately this tells nothing about the language the app is actually displaying. It will just give you the ordered list as found in "Settings → General → Language & Region → Preferred Language" Order on iOS, or "System Preferences → Language & Region → Preferred Languages" on OS X.
Imagine that the preferred language order is {English, French} but your app is German only. Calling [[NSLocale preferredLanguages] firstObject] will give you English when you want German.
The proper way to get the actual language used by the app is to use [[NSBundle mainBundle] preferredLocalizations].
From http://nshipster.com/new-years-2015/#nsbundle--preferredlocalizations.
I believe this also solves your issue @duemunk.
The text was updated successfully, but these errors were encountered: