为什么我的应用程序无法获取 Localized.strings 文件中的文本?
我正在尝试本地化我的 iPhone 应用程序,我尝试向 Google 寻求帮助并查看此处,但我找不到任何我做错的事情。
我创建了一个 Localized.strings 文件,当前仅包含:
/*
Localizable.strings
AppName
Created by Joe on 25/10/2011.
Copyright (c) 2011 xxx. All rights reserved.
*/
"DestinationHeader" = "I am going to";
然后我转到 XCode 右侧的“本地化”选项卡,并将“English”添加到该文件中。现在该文件出现在捆绑包中的 en.lproj 文件夹中。
然后,在视图控制器中,我添加了以下行:
sectionTitle = NSLocalizedString(@"destinationHeader", nil);
但似乎发生的所有事情都是出现文本“destinationHeader”,而不是“我要去”。我显然做错了什么,有人有什么想法吗?
谢谢!
:-乔
I'm trying to localise my iPhone app, and I've tried to Google for help and look on here but I can't find anything that I am doing incorrectly.
I have created a Localizable.strings file, which currently only contains:
/*
Localizable.strings
AppName
Created by Joe on 25/10/2011.
Copyright (c) 2011 xxx. All rights reserved.
*/
"DestinationHeader" = "I am going to";
I then went to the Localization tab on the right in XCode, and added "English" to the file. Now the file appears in my en.lproj folder in the bundle.
Then, in the view controller, I've added the line:
sectionTitle = NSLocalizedString(@"destinationHeader", nil);
But all that seems to be happening is the text "destinationHeader" is appearing instead of "I am going to". I'm obviously doing something wrong, does anyone have any ideas?
Thanks!
:-Joe
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
您应该在 localized.strings 中输入相同的键值,并且区分大小写。
Try this:
You should enter the same value of key in localizable.strings and it is case sensitive.