I have an app that has some non-US Localizable.strings files. They appear in the project as I expect them to: there\'s a Localizable.strings object, and sub objects for \"en
And if you run an application with the Localizable.strings file in the root of the project, cleaning is not enough, you also need to delete the application from the simulator.
This happens (apparently) when there is a Localizable.strings file in the root of the project in addition to in the individual .lproj directories. The app seems to always prefer that if it's present. The fact that it was there was likely an artifact of mucking around trying to get the localizations working in the project.
I'm leaving this question here in case others run into this issue.
I solved this way: I deleted the app from the simulator and in xcode: Product -> Clean
For the particular problem of en_US always coming back, you need to be querying preferredLanguages
for the array of preferred languages currently, not currentLocale
.
Does NSLocalizedString does not return the keyed string from the correct file?
IN localization you have to be sure you are changing what you think you are changing. If you change Language in preferences then it will affect the string that comes back from your localizable.strings file. If you change settings under Region Format that's only date, currency symbol etc.
It can also help to uninstall the application from the simulator after localizing a .NIB, as the localized version will have two (or more) new files in new locations (like, 'en.lproj', 'fr.lproj'). However, when you build to the simulator, it's too stupid to know to delete the old .xib file, so it'll keep loading the old stale xib file, not your new localized version until you clean the device out by reinstalling the app.