适用于新UI的iOS故事板本地化 [英] iOS storyboard localization for new UI
问题描述
我在项目中使用Xcode 5。而项目需要本地化。 Xcode帮助我生成 Localizable.strings
它看起来像
I use Xcode 5 in a project. and the project need to localization. Xcode had help me generated Localizable.strings
it looks like
/* Class = "IBUIButton"; normalTitle = "2013-10-1"; ObjectID = "p5u-h7-pfJ"; */
"p5u-h7-pfJ.normalTitle" = "2013-10-1";
/* Class = "IBUILabel"; text = "Label"; ObjectID = "pBS-eN-YUz"; */
"pBS-eN-YUz.text" = "Label";
/* Class = "IBUITextField"; placeholder = "Input Name Here"; ObjectID = "pE4-WG-fPp"; */
"pE4-WG-fPp.placeholder" = "Input Name Here";
/* Class = "IBUILabel"; text = "Detail"; ObjectID = "qSu-Mo-baT"; */
"qSu-Mo-baT.text" = "Detail";
但如果我想在故事板中添加新的UI,我该怎么办?如何添加新的键值?
but how should I do if I want to add new UI in the storyboard. How can I add new key-value?
推荐答案
在故事板中,每个对象都有一个ID。在实用工具视图中,'Identity Inspector'拇指,'文档'部分,有一个字段'对象ID'
In your storyboard, every single Object has an ID. In the 'Utilities' view, 'Identity Inspector' thumb, 'Document' section, there is a field 'Object ID'
我从未使用过这个,但是我猜测,如果你有一个ID 141-wB-KQD
的标签,并且你想设置它的文本属性,你必须放入你的 Localizable .strings
:
I've never used this, but I guess that, if you have a label with ID 141-wB-KQD
and you want to set its text property, you have to put in your Localizable.strings
:
"141-wB-KQD.text" = "the value you want";
这篇关于适用于新UI的iOS故事板本地化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!