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.
Attachments
For Gerrit Dashboard: QTBUG-43447 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
105264,5 | Fix regression from Qt4 with layout direction | dev | qt/qtbase | Status: MERGED | +2 | 0 |
105361,3 | Fix regression from Qt4 with layout direction | dev | qt/qttranslations | Status: MERGED | +2 | 0 |
126056,2 | Move QT_LAYOUT_TRANSLATION to QGuiApplication context. | 5.6 | qt/qttranslations | Status: MERGED | +2 | 0 |