如何本地化辅助功能标签
我正在研究 iOS 中的辅助功能。我似乎无法找到如何针对不同区域设置本地化标签。
如果我直接在界面生成器中的笔尖中输入标签,我是否只能通过本地化整个笔尖来本地化这些标签?或者有没有办法将它们导出到字符串文件?
I'm researching accessibility features in iOS. I can't seem to find how you localise the label for different locales.
If I enter labels directly into the nib in interface builder, can I only localise these by localising the WHOLE nib? Or is there a way to get these exported to a string file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您问题的答案是,整个 nib(实际上是 xib)旨在针对每种语言进行本地化。有一种用于英语的 xib,一种用于西班牙语,一种用于日语,等等。
The answer to your question is that the WHOLE nib (or xib, actually) is meant to be localized per language. There's one xib for English, one for Spanish, one for Japanese, etc.
似乎可以使用 IBOutlet 以编程方式设置辅助功能标签,其方式与在 xib 中设置任何其他 UI 组件相同。
本地化的最佳实践/技术完全是另一个主题,但我们通常会尽可能避免本地化 xib(例如,确保设计有足够的空间来处理我们支持的语言之间的差异,避免图像中的文本等),依赖于NSLocalizedString 调整面向用户的(和/或用户可听到的?)副本。
It seems as though programmatically setting the accessibility labels could be accomplished in the same manner as setting any other UI component in a xib, using IBOutlets.
Best practices / techniques for localization is another topic entirely, but we generally avoid localizing the xib when possible (eg. ensuring that designs have enough space to handle the differences among the languages we support, avoiding text in images, etc.), relying on NSLocalizedString to adjust user-facing (and/or user-audible?) copy.
您也可以通过编程方式完成此操作,不需要多个笔尖:
取自 辅助功能编程指南iOS
You can also do it programmatically, no need for multiple nibs:
Taken from the Accessibility Programming Guide for iOS