Cocoa 中当前的文本方向(BiDi 支持)?
我最近收到了我的应用程序的阿拉伯语翻译,但我想做的不仅仅是简单地替换字符串。我可以使用 Interface builder 重新布局大多数 NIB,但有一些事情需要以编程方式完成。
Cocoa 中是否有某种方法可以确定当前区域设置是否为 RightToLeft 区域设置,或者我只需检查当前区域设置是阿拉伯语还是希伯来语?
我一直在寻找有关 Cocoa 应用程序的“Bidi”文章或信息一段时间,但运气不佳。有什么建议吗?
谢谢。
I recently received an Arabic translation for my app, but would like to do more than simply replace the strings. I can re-layout most of the NIBs with Interface builder, but there are a few things that I need to do programmatically.
Is there some way in Cocoa to figure out if the current locale is a RightToLeft locale, or do I just have to check to see if the current locale is Arabic or Hebrew?
I have been searching for any "Bidi" articles or information for Cocoa apps for a while now, but without much luck. Any suggestions?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 10.6 中,请参阅
-[NSApplication userInterfaceLayoutDirection]
。对于早期版本,没有明确的支持,所以是的,您可以只查找特定的区域设置。您可以执行
respondsToSelector
检查,以在任何可用的系统上使用-userInterfaceLayoutDirection
。有关此更改和其他更改,请参阅 AppKit 发行说明。
In 10.6, see
-[NSApplication userInterfaceLayoutDirection]
. For earlier releases, no explicit support, so yeah, you could just look for specific locales.You can do a
respondsToSelector
check to use-userInterfaceLayoutDirection
on any system on which it is available.See the AppKit release notes for this and other changes.