Localizing my iphone app, not using the localized files correctly
I am trying to localize my app. I have added locale "sv" (Swedish). I have localized both my xib file and a plist with some information I need.
When setting the simulator to English, it is using the English xib. Also, when setting the simulator to Swedish (both language and region) it still use the default English xib.
For the plist it is the opposite around. It always uses the sv-version no matter if I use English or Swedish settings.
I always change both the language and region.
I assume that I don't have to do anything special in the code, the app should just pick th开发者_JAVA百科e correct file based on the settings on the phone, right?
I don't know how to debug from here, or fix the problem. Please advice.
Thanks!
Probably you did something wrong with your project configuration - you are using the proper language code.
I can only assume that you have a folder sv.lproj
in your project directory, one that contains localized versions of the files from en.lproj
.
I recommend you to create a new application and add just the localized plist to it and check if it works. Probably it will work and you'll be able to sync project config or just move the code from the old one to the new one.
Clean All Targets... I wanted to do this but it was always disabled. But since I'm such a newbie I didn't think about that you can only clean target when the app is not running in the simulator. But cleaning the targets made it work.
Resetting the content of the app was not sufficient but I do need to both cleant targets and reset simulator in order to get it to work.
I would be most happy to have it comfirmed that this is something that's supposed to be needed or if there's something with my application/xCode that isn't working corretly.
精彩评论