For some reason I cannot get the Settings.bundle to recognize my additional languages. I must be missing something obvious, but I just cannot figure it out. Here\'s what I\'ve
In Xcode 5 there is still no obvious way to localize the Settings.bundle.
Xcode doesn't allow you to localize a file that is only shown because it is a file inside a folder that's directly shown in Xcode (hence the blue folder icons in the tree).
In my case, it appeared as if "Strings Filename"
was set to "Root"
in the Property List View of Root.plist
, but when viewed the file in Source Code View, it was actually "StringsTable"
pointing to "Root"
. The solution is to add another entry where "Strings Filename"
points to "Root"
. (I also tried deleting the previous entry, but then it stops working, so you need both.)
For me, the problem was leaving off a semi-colon!
In localizable.strings, you get a runtime error if you omit the ";", but in Root.strings, you don't get any warnings, you can run it fine, but it just won't work!
So double-check to make sure you punctuate each key:value pair with a semi-colon!
I'll go ahead and answer my own question since I solved the problem myself through testing and failing. Hopefully this will help someone else in the future.
First, I think my Root.plist
file may have been corrupted. I'm not exactly sure why, but I completely deleted the Settings.bundle
, and re-created it to be sure.
Second, and perhaps most importantly, the main issue was the "key" in the root.strings
file didn't match to the "key
" field in the Root.plist
, it actually matches the "Title
" field.
Once I made those changes to the Root.strings
file, it all started to work.
After some repeated tries to activate localization,following steps worked for me:
Duplicate the en.lproj folder and rename to whatever language you want (using 2-letter code ie fr.lproj)
Replace the original settings bundle with the new one(without opening xcode).
Now delete the older app and run xcode,Works fine in simulator and on device.
NOTE:Closing xcode,updating of duplicated setting bundle outside xcode and replacing updated back only will help.
All you have to do is keep (or Add, if it's not there) "Strings Filename" in the Root.plist, after your settings.
Then, add Value "Root" (or, the name of your file and the translations) to make the created lang.lproj translations functional.