Most right-to-left language speakers expect that the application content is aligned to the right. Therefore they read and scan text and content in the right-to-left order. This page summarizes the right-to-left support - that is, the "mirroring" - implemented in Symbian QML components. It also provides some hints for developing an application that supports right-to-left UI.
QML provides the right-to-left support in QtQuick 1.1. For more information, see http://doc.qt.nokia.com/4.7-snapshot/qml-righttoleft.html
The right-to-left (RTL) support in Symbian QML components is enabled by setting the LayoutMirroring.enabled property to true. The application needs to enable it to indicate that it supports the RTL user interface.
The context property symbian.rightToLeftDisplayLanguage can be used to enable RTL in the application when the current display language is right-to-left. The following code snippet illustrates this. Because the childrenInherited property is true, the alignment value is inherited to all child elements - except those child elements whose alignment property is explicitly set.
Enabling right-to-left UI in the application's main QML file:
LayoutMirroring.enabled: symbian.rightToLeftDisplayLanguage LayoutMirroring.childrenInherit: true
Other possibility is to bind the LayoutMirroring.enabled property to the value of Qt.application.layoutDirection property, which by default determines the layout direction from the active language translation file. It requires, however, that the dedicated translation string literal QT_LAYOUT_DIRECTION is translated to either "LTR" or "RTL" in the QApplication scope. For more information, see http://doc.qt.nokia.com/4.7-snapshot/qml-righttoleft.html
The Symbian QML components implement RTL as it is specified in the platform style. This means mainly the following:
The following components are not mirrored due to their nature:
To enable the mirroring of the ListItemText component's text alignment, set its width to cover the whole area of the component.
Similarly, to enable the mirroring of the QML's Text component's text alignment, set its width to cover the whole area of the component. When the layout direction is right-to-left, the alignment of the text is handled as follows (this also applies to QML's TextInput and TextEdit elements, see http://doc.qt.nokia.com/4.7-snapshot/qml-righttoleft.html):
When you implement the RTL support for your application, you should take care of the following things: