Summary

If you are planning to localize your application into a language that has an RTL reading order such as Arabic or Hebrew, both the text and the UI elements will need to be laid out from right to left. The mirroring technology gives a perfect RTL look and feel to an application's UI, whether you are dealing with a Microsoft Win32 application, a Web-based application, or an application within the .NET Framework.

For Win32 applications, you can either enable mirroring in resources or in code. The first approach is a good one when you want to mirror old components for which the source is not available or is no longer used; it is also beneficial when you want to conduct primary testing of your applications to see if they support mirroring. However, this method does not allow you to apply mirroring to a specific window or control, since all windows and their controls will be mirrored automatically. In addition, mirroring in resources is merely a workaround used mainly for primary testing; it is not a Microsoft-supported development technique.

A better method is to enable mirroring in code. By doing so, you can identify exactly what you want to be mirrored. You also have the liberty of determining whether you want to mirror per process, per window, for dialog resources, or per device context. If you activate mirroring per process, all newly created windows are automatically mirrored, though existing windows are unaffected. Activating mirroring per window allows you to deactivate mirroring for particular windows. By activating mirroring per device context and by calling various GDI functions, you can control whether a bitmap or icon should be mirrored, since the device context of a mirrored window is normally mirrored by default.

In terms of mirroring Web content, Internet Explorer's rendering engine is mirroring-aware. By applying the DIR=RTL attribute in your HTML code, you can set the reading order of the text to RTL, align the text to the right, and mirror dynamic elements, tables, and cells. When working with Web content involving RTL languages, avoid specifying ALIGN=LEFT unnecessarily, avoid CSS absolute positioning, and use tables for robust reversibility.

Within the .NET Framework, use the DIR attribute in the <HTML> tag or the <BODY> tag for Web Forms. For Windows Forms, provide RTL support with the Control class and the RightToLeft property. Finally, for message boxes use the MessageBox class, which fully supports RTL reading order and mirroring. These guidelines will help you create a fully localizable UI for RTL languages.



Microsoft Corporation - Developing International Software
Developing International Software
ISBN: 0735615837
EAN: 2147483647
Year: 2003
Pages: 198

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net