从右到左的 UI 指南?
我正在研究对专有 UI 框架(用于桌面应用程序)的 RTL 支持,我想知道:是否有关于如何更改小部件渲染的指南?
我正在寻找诸如以下内容的列表:
- 复选框标签位于复选框的左侧,右对齐的
- 工具栏按钮从右向左流动
- 垂直滑块位于左侧的 sice
- 窗口装饰???
- ...
I'm looking into RTL support for a proprietary UI framework (for a desktop app), and I'm wondering: are there guidelines as to how the widget rendering has to change?
I'm looking for a list of things like:
- checkbox labels are on the left of the checkbox, and right-aligned
- toolbar buttons flow from right to left
- vertical sliders are on the left sice
- window decoration ???
- ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一般来说,布局应该是水平翻转的镜像。除了您已经提到的控件之外,显然单选按钮、组合框(又名下拉菜单)、旋转(或上下,取决于术语)应该被镜像。窗口装饰或窗口控制框,即最小化、最大化和关闭按钮应位于另一侧。窗口标题也是如此。
按钮的顺序也应该改变,所以如果你有[确定][取消][帮助],在RTL语言中,它将是[帮助][取消][确定]。弹出消息中的图标应位于另一侧。
您可能想知道 Microsoft 如何在其 MFC 框架中实现 RTL 支持:他们只是更改了坐标,以便 0,0 指向屏幕的右上角,并且当您向左移动时 x 坐标会增加边。这有一些副作用,可以在分割器控制中观察到 - 它的工作方式与人们期望的完全相反(将其拖动到左侧会放大窗口的左侧部分)。
回到控件:显然,LTR 语言中的文本框是左对齐的,而 RTL 语言中的文本框应该是右对齐的,等等。
绝对不太明显的是,一些位图也应该翻转。让我特别惊讶的是,当本地化为阿拉伯语、乌尔都语或波斯语时,问号图标(通常与确认对话框一起显示或作为帮助按钮显示)应该被翻转,对于 反转问号 (⸮) 是他们使用的。不过我不确定希伯来语。
请记住,由于文化原因,某些位图需要本地化(例如其中一些可能不合适)。此外,在本地化为阿拉伯语(以及类似的语言),但将它们用于希伯来语并不是一个好主意。正如您可以想象的那样,如果您有一些漂亮的要点图像(包含数字)并且应用程序(或框架)需要翻译成阿拉伯语,那么这些图像至少需要可本地化(即可替换)。
Generally layout should be mirrored that is horizontally flipped. Apart from controls you already mentioned, obviously radio buttons, combo boxes (aka drop down menus), spins (or up and downs, depending on the terminology) should be mirrored. Window decoration, or window control boxes, that is minimize, maximize and close buttons should be on opposite side. The same regards to window's title.
The order of the buttons should be changed as well, so if you have [OK] [Cancel] [Help], in RTL languages, it will be [Help] [Cancel] [OK]. Icons in pop-up messages should be on the other side.
You might want to know how Microsoft implemented RTL support in their MFC framework: they simply changed coordinates, so that 0,0 points to upper right corner of the screen and x coordinate increases when you move to the left side. This has some side effect which is observable in splitter control - it works exactly the other way round that one would expect (dragging it to the left side enlarges left part of the window).
Going back to controls: Obviously left-aligned text boxes in LTR languages, should be right aligned in RTL languages and so on.
What is definitely less obvious, some bitmaps should be flipped as well. What particularly surprised me, question mark icon (the one usually shown with confirmation dialog or as a help button) should be flipped when Localizing to Arabic, Urdu or Persian, for Reversed Question Mark (⸮) is what they use. I am not sure about Hebrew though.
Please keep in mind that some bitmaps need to be localized for cultural reasons (for example some of them might be inappropriate). Also, it is more or less required to use so called Eastern Arabic numerals while localizing into Arabic (and similar languages) but it is not a good idea to use them for Hebrew. As you can imagine, if you have some nice images for bullet points (containing numerals) and the application (or framework) needs to be translated into Arabic, these images need to be at least localizable (that is replaceable).