Xcode 6 Beta 4 using Swift.
I use localization in my project and I have experience in localization from Xcode 5.
Localization in program code using NSLocalizedString()
works fine.
Localization of Info.plist
strings work fine, too.
When it comes to localize the strings from Interface Builder it only works in Interface Builder preview but not in simulator and not on my device (iPhone 5S).
Am I missing something or can anyone confirm this as a bug in in Xcode 6 Beta 4?
It seems like the problem is with the size classes.
If "Use Size Classes" checkbox is enabled for storyboard, the Xcode actually generates 3 versions of it ("<Name>.storyboard", "<Name>~ipad.storyboard" and "<Name>~iphone.storyboard"
).
So iOS just tries to load .strings file which name matches the name of active storyboard (<Name>~iphone.strings
in case app is running on the iPhone). And being not able to find that file, it falls back to Base localization.
There are a couple of ways to work around this bug:
<Name>~iphone.strings
and <Name>~ipad.strings
files to the project manualy and copy your translations over.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With