Classes - Annotated - Tree - Functions - Home - Structure

Porting applications to Hebrew and Arabic

Even though Qt tries to remove most of the burden of enabling applications for Hebrew and Arabic from the programmer, there are a few points left where the programmer has to take care. This document will try to describe most of the problems that can occur when trying to translate and use the application in Hebrew or Arabic.

Difference with other languages

Hebrew and arabic are different from most other languages in that they are written from right to left. Numbers and english words embedded in a hebrew or arabic sentence however are still written left to right. Text is however stored on disk in the logical order, so displaying and editing has to use an algorithm to reorder the string into the visual order the user would expect.

A simple example is the following string (big letters are Hebrew or Arabic):

THIS IS AN english WORD.

The visual output of this would be:

.DROW english NA SI SIHT

Qt takes care of all these formatting and reordering issues internally, so you will not have to care about it.

Many functions using the QPainter::drawText( int x, int y, const QString &text ) method will however get a wrong alignment of their text as localized versions should have all text right aligned.

Using the variant of drawText that takes a rectangle to draw text into will correctly take care of alignment issues. Hebrew or arabic text will be right aligned, other text left aligned by default.


Copyright © 2001 TrolltechTrademarks
Qt version 3.0.0-beta1-beta1