Localization strings file not working with xib in Xcode 5

十年热恋 提交于 2019-12-10 05:31:58

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/20484066/localization-strings-file-not-working-with-xib-in-xcode-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!