Xcode 4.2 中的本地化
我无法在 iPhone 应用程序中进行本地化。 这就是我所做的:
NSString *one = NSLocalizedString(@"Apple", @"Apple");
NSLog ("%@", one);
在应用程序信息中我添加了法语。我将文件 Localized.strings
(UTF-16) 移动到 fr.lproj
文件夹。该文件包含:
/* Apple */
"Apple" = "Pomme";
我将iPhone Simulator中的语言更改为法语,然后我使用了Product ->清理干净,再次运行项目,但没有任何效果。我得到“苹果”。
问题可能是什么?也许我错误地创建了 Localized.strings
文件?
我认为问题出在模拟器上,因为当我添加法语 xib 文件时,我遇到了同样的问题,但我不知道出了什么问题。
I can not make a localization in an iPhone app.
Here's what I did:
NSString *one = NSLocalizedString(@"Apple", @"Apple");
NSLog ("%@", one);
In info of application I added French. I moved the file Localizable.strings
(UTF-16) to fr.lproj
folder. The file contains:
/* Apple */
"Apple" = "Pomme";
I changed the language in iPhone Simulator to French, then I used Product -> Clean, and ran the project again, but it doesn't have any effect. I am getting "Apple".
What can the problem be? Maybe I'm creating Localizable.strings
file incorrectly?
I think the problem is with Simulator, because when I added a French xib file I had the same problem, but I have no idea what is wrong with that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我从这个学到了本地化讲座,据我所知您的代码是正确的。首先jy从你的目录中删除模拟器文件(可能是/Library/Application Support/iPhone Simulator是它的路径)并再次编译
I had learned Localizaation from this lecture and as far as i see your code is true. Firstjy delete simulator files from your directories (probably /Library/Application Support/iPhone Simulator is its path) and compile again