Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.3.0, 5.4.0
-
None
-
Linux, Windows
-
qtbase.git: 49af548abb03743eabb8727ac685e1c290cb2118, qttranslations.git: dc511a947ab16429682e4887f95f94fc8bcb6fd2
Description
When an application loads with a right to left language (e.g. Persian, Arabic) it's layout should be switched to Qt::RightToLeft, too.
There's a translatable string within QApplication class (i.e. tr("QT_LAYOUT_DIRECTION")) responsible for detecting correct layout direction for loaded translation language.
This works on Qt4 but it doesn't work on Qt5.
P.S.: The language file qt_*.qm is loaded successfully because when I add the following line to the application it works correctly:
a.setLayoutDirection(QApplication::tr("QT_LAYOUT_DIRECTION") == QLatin1String("RTL") ? Qt::RightToLeft : Qt::LeftToRight);
A sample file was attached.