Xcode 6: iOS doesn't use storyboard localizations

白昼怎懂夜的黑 提交于 2020-01-03 17:16:11

问题


since I upgraded my Xcode project to Xcode 6, my storyboard localizations don't work. I have:

  • A base localization as storyboard file (which is basically English)
  • Four string files: English, German, French and Japanese

Until Xcode 5 those worked without any problems.

But since Xcode 6 I have the following situation:

  1. The application only uses the labels used in the base file when running on a device/simulator
  2. BUT my Localizable.strings file, which I have in different languages for all non-storyboard related localizations, works perfect. (So in the end I have a mixture of languages while running on a device)
  3. Since Xcode 6 there is the possibility to see the localizations as a preview screen in the assistant editor. Everything works there.

So: the only thing that doesn't work is the localization of the storyboard while running

Does anyone else have the same problem and is there a solution?

Update: With Xcode 6.1 GM the localization on the actual device is correct now but the simulator is English only, even if I choose another language in the simulator.


回答1:


I am experiencing the samen problem. I have been struggling for hours getting my localized storyboard to work in Xcode 6.0, until I read your question. Then I tried the second GM of Xcode 6.1. There, my UILabels were localized properly on the device (not in the simulator). However, my UITextView did not get localized, which took me another 30 minutes to figure out.

Hopefully, this will be fixed soon.




回答2:


I thought I had the same problem as I couldn't see any of my translated texts appearing in the simulator. I tried using a dummy new project and it worked which made me not so sure about what the problem was.

Then I decided to use a dedicated editor for the translation. After exporting, translating the files via the editor and importing them, I could see the correct texts in the iOS simulator. So I guess that it was the way I edited them manually which caused the issue.

FYI, the tool I used is https://poeditor.com




回答3:


I've been experiencing the same issue. The solution is: you need to clean (shift-cmd-k) a project first, then you build and run it.




回答4:


Try to switch localization files to “interface builder storyboard” instead of “localizable strings”. For some reason in my project Storyboard.storyboard works, but Storyboard.strings doesn’t. Probably xcode bug.



来源:https://stackoverflow.com/questions/26147439/xcode-6-ios-doesnt-use-storyboard-localizations

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