diff options
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/QtStrings.h | 2 | ||||
-rw-r--r-- | Swift/QtUI/main.cpp | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/Swift/QtUI/QtStrings.h b/Swift/QtUI/QtStrings.h index 586e775..d0cd421 100644 --- a/Swift/QtUI/QtStrings.h +++ b/Swift/QtUI/QtStrings.h @@ -16,7 +16,7 @@ QT_TRANSLATE_NOOP("CloseButton", "Close Tab"); -QT_TRANSLATE_NOOP3("QApplication", "QT_LAYOUT_DIRECTION", "Translate this to LTR for left-to-right or RTL for right-to-left languages"); +QT_TRANSLATE_NOOP3("QGuiApplication", "QT_LAYOUT_DIRECTION", "Translate this to LTR for left-to-right or RTL for right-to-left languages"); QT_TRANSLATE_NOOP("QLineEdit", "Select All"); QT_TRANSLATE_NOOP("QLineEdit", "&Undo"); diff --git a/Swift/QtUI/main.cpp b/Swift/QtUI/main.cpp index 4850b49..472c99a 100644 --- a/Swift/QtUI/main.cpp +++ b/Swift/QtUI/main.cpp @@ -107,6 +107,14 @@ int main(int argc, char* argv[]) { QtTranslator swiftTranslator; Swift::Translator::setInstance(&swiftTranslator); +#if QT_VERSION < 0x050501 + /* According to Qt documenation, Qt is suppsoed to set the applications layout + * direction based on the translatable QT_LAYOUT_DIRECTION string. There is a + * bug in Qt prior version 5.5.1, i.e. QTBUG-43447, thus we set the layout + * direction manually based on the tranlsated QT_LAYOUT_DIRECTION string. + */ + app.setLayoutDirection(QGuiApplication::tr("QT_LAYOUT_DIRECTION") == QLatin1String("RTL") ? Qt::RightToLeft : Qt::LeftToRight); +#endif Swift::QtSwift swift(vm); int result = app.exec(); |