Localization strings file not working with xib in Xcode 5

1.4k views Asked by At

I have the following file structure for localization.

A.xib

->A.xib (Base)

->A.strings (Spanish)

->A.strings (English)

Since it is "Use Base Internationalization". We can expect to have only one xib file and required strings file for the localization.

But, soon as i convert this strings file to .xib (where for each language we have .xib file. This was the case before Base Internationalization). Things start working the iOS simulator and device responds to such changes.

Note:- I had also tried to reset the simulator , clean and created the build but no success.

Don't know why localization fails when I use .strings file for localization.

Any help appreciated for a , small bug consuming more time on Xcode IDE and eating up development time.

2

There are 2 answers

0
n6xej On

In Xcode 6 you need to select "Use Auto Layout" in order for the strings file to be used. There is a known problem if you do the following:

1)Your storyboard or XIB uses size classes.
2)The base localization and build target are set to Universal. 
3)The build target is for iOS 7.0

You can use the Localizable Strings to generate a localized XIB file automatically through Xcode, which is what you need to do if you do not enable Auto Layout.

0
Offek On

It's a bug in Xcode. All you have to do is to convert the Localizable Strings file to an Interface Builder file. You can do that under the Localization section on the interface builder's file properties.