diff options
author | Jan Arve Saether <jan-arve.saether@theqtcompany.com> | 2015-02-03 14:54:52 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-02-05 14:27:22 +0000 |
commit | 49af548abb03743eabb8727ac685e1c290cb2118 (patch) | |
tree | 9c37db074cc6be383ff9aabbe3a2c651736bee1f /tests/auto/other/languagechange | |
parent | 1043bf202bb848f8286f2c67ed2b8760fe9da8da (diff) | |
download | qtbase-49af548abb03743eabb8727ac685e1c290cb2118.tar.gz |
Fix regression from Qt4 with layout direction
In Qt4, if the result of the translation
QApplication::translate("QT_LAYOUT_DIRECTION")
returned "RTL", Qt usually called
QApplication::setLayoutDirection(Qt::RightToLeft)
in order for a translation file to specify if the UI should be
left-to-right or right-to-left.
However, due to modularization, we could no longer call
QApplication::translate(), so the code was wrongly changed to call
QCoreApplication::translate(....) instead.
This was wrong, and in addition the translation files was never updated
with the new context.
This patch fixes it to only translate it with the QGuiApplication context.
This is the only sensible context, since QApplication would lack QtQuick
support, and QCoreApplication would not know how to change layout
direction.
[ChangeLog][QtGui][i18n] Fixed bug where layout direction did not switch
according to the instruction in the translation file.
Task-number: QTBUG-43447
Change-Id: Id0409a42d41b3b9ff1cd53d090c4d9c9802f5659
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'tests/auto/other/languagechange')
-rw-r--r-- | tests/auto/other/languagechange/tst_languagechange.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/other/languagechange/tst_languagechange.cpp b/tests/auto/other/languagechange/tst_languagechange.cpp index 7b71231382..caf000a418 100644 --- a/tests/auto/other/languagechange/tst_languagechange.cpp +++ b/tests/auto/other/languagechange/tst_languagechange.cpp @@ -243,7 +243,7 @@ void tst_languageChange::retranslatability() QSKIP("The input data are not suitable for this layout (QDialogButtonBox::GnomeLayout)"); // This will always be queried for when a language changes - expected.insert("QCoreApplication::QT_LAYOUT_DIRECTION::Translate this string to the string 'LTR' in left-to-right " + expected.insert("QGuiApplication::QT_LAYOUT_DIRECTION::Translate this string to the string 'LTR' in left-to-right " "languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to " "get proper widget layout."); |