Ios Localization not working

不问归期 提交于 2019-12-23 18:39:29

问题


I have XCode Version 4.3.3 running and iOS 5.1. i can do what i want. i can't get localization running. i added different languages through project files. I adjusted the InfoPlist.strings in every Language like this:

"key" = "value";

I have everywhere:

NSLocalizedString(@"key", nil);

No key is the same like its value. I have checked the which language is chosen:

NSString * language = [[NSLocale preferredLanguages] objectAtIndex:0];

But the app constantly just shows the keys and no value when i run the App.

I ran out of ideas

I tried deleting and cleaning everything as described here: Localization not working

I tried copying the files described here: NSLocalizedString Problem

And all the files are in their language folder: iPhone: NSLocalizedString reading from English .strings file even when another lang is set

Does anybody have an idea what else i can do?!? i don't know what i am doing wrong?!


回答1:


Do you have a Localizable.strings file? That's the default file that

NSLocalizedString(@"key", nil);

looks for.




回答2:


When using Xcode 5.1.1 and the 7.1 Simulator, the localisation is not reliable. Testing on real hardware does work.



来源:https://stackoverflow.com/questions/11543025/ios-localization-not-working

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