summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
Diffstat (limited to 'Swift')
-rw-r--r--Swift/ChangeLog.md4
-rw-r--r--Swift/QtUI/QtStrings.h2
-rw-r--r--Swift/QtUI/main.cpp8
-rw-r--r--Swift/Translations/swift_ca.ts2
-rw-r--r--Swift/Translations/swift_cs.ts2
-rw-r--r--Swift/Translations/swift_de.ts2
-rw-r--r--Swift/Translations/swift_es.ts2
-rw-r--r--Swift/Translations/swift_fr.ts2
-rw-r--r--Swift/Translations/swift_gl.ts2
-rw-r--r--Swift/Translations/swift_he.ts2
-rw-r--r--Swift/Translations/swift_hu.ts2
-rw-r--r--Swift/Translations/swift_nl.ts2
-rw-r--r--Swift/Translations/swift_pl.ts2
-rw-r--r--Swift/Translations/swift_ru.ts2
-rw-r--r--Swift/Translations/swift_sk.ts2
-rw-r--r--Swift/Translations/swift_sv.ts2
16 files changed, 26 insertions, 14 deletions
diff --git a/Swift/ChangeLog.md b/Swift/ChangeLog.md
index 0ff29c8..017f156 100644
--- a/Swift/ChangeLog.md
+++ b/Swift/ChangeLog.md
@@ -1,3 +1,7 @@
+4.0-in-progress
+---------------
+- Fix UI layout issue for translations that require right-to-left (RTL) layout
+
4.0-beta2 ( 2016-07-20 )
------------------------
- Fix Swift bug introduced in 4.0-beta1 that results in the UI sometimes getting stuck during login
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();
diff --git a/Swift/Translations/swift_ca.ts b/Swift/Translations/swift_ca.ts
index a512f1f..8fa72b2 100644
--- a/Swift/Translations/swift_ca.ts
+++ b/Swift/Translations/swift_ca.ts
@@ -704,7 +704,7 @@
</message>
</context>
<context>
- <name>QApplication</name>
+ <name>QGuiApplication</name>
<message>
<location filename="../QtUI/QtStrings.h" line="19"/>
<source>QT_LAYOUT_DIRECTION</source>
diff --git a/Swift/Translations/swift_cs.ts b/Swift/Translations/swift_cs.ts
index 314cd60..3621733 100644
--- a/Swift/Translations/swift_cs.ts
+++ b/Swift/Translations/swift_cs.ts
@@ -697,7 +697,7 @@
</message>
</context>
<context>
- <name>QApplication</name>
+ <name>QGuiApplication</name>
<message>
<location filename="../QtUI/QtStrings.h" line="19"/>
<source>QT_LAYOUT_DIRECTION</source>
diff --git a/Swift/Translations/swift_de.ts b/Swift/Translations/swift_de.ts
index 3f86218..6eaa2ca 100644
--- a/Swift/Translations/swift_de.ts
+++ b/Swift/Translations/swift_de.ts
@@ -879,7 +879,7 @@
</message>
</context>
<context>
- <name>QApplication</name>
+ <name>QGuiApplication</name>
<message>
<location filename="../QtUI/QtStrings.h" line="19"/>
<source>QT_LAYOUT_DIRECTION</source>
diff --git a/Swift/Translations/swift_es.ts b/Swift/Translations/swift_es.ts
index 384c411..e6d414d 100644
--- a/Swift/Translations/swift_es.ts
+++ b/Swift/Translations/swift_es.ts
@@ -704,7 +704,7 @@
</message>
</context>
<context>
- <name>QApplication</name>
+ <name>QGuiApplication</name>
<message>
<location filename="../QtUI/QtStrings.h" line="19"/>
<source>QT_LAYOUT_DIRECTION</source>
diff --git a/Swift/Translations/swift_fr.ts b/Swift/Translations/swift_fr.ts
index b95c0d1..f344a83 100644
--- a/Swift/Translations/swift_fr.ts
+++ b/Swift/Translations/swift_fr.ts
@@ -573,7 +573,7 @@
</message>
</context>
<context>
- <name>QApplication</name>
+ <name>QGuiApplication</name>
<message>
<location filename="../QtUI/QtStrings.h" line="19"/>
<source>QT_LAYOUT_DIRECTION</source>
diff --git a/Swift/Translations/swift_gl.ts b/Swift/Translations/swift_gl.ts
index c189a1d..46acb93 100644
--- a/Swift/Translations/swift_gl.ts
+++ b/Swift/Translations/swift_gl.ts
@@ -575,7 +575,7 @@
</message>
</context>
<context>
- <name>QApplication</name>
+ <name>QGuiApplication</name>
<message>
<location filename="../QtUI/QtStrings.h" line="19"/>
<source>QT_LAYOUT_DIRECTION</source>
diff --git a/Swift/Translations/swift_he.ts b/Swift/Translations/swift_he.ts
index 600366d..3a8f400 100644
--- a/Swift/Translations/swift_he.ts
+++ b/Swift/Translations/swift_he.ts
@@ -697,7 +697,7 @@
</message>
</context>
<context>
- <name>QApplication</name>
+ <name>QGuiApplication</name>
<message>
<location filename="../QtUI/QtStrings.h" line="19"/>
<source>QT_LAYOUT_DIRECTION</source>
diff --git a/Swift/Translations/swift_hu.ts b/Swift/Translations/swift_hu.ts
index 54167e2..d8601aa 100644
--- a/Swift/Translations/swift_hu.ts
+++ b/Swift/Translations/swift_hu.ts
@@ -454,7 +454,7 @@
</message>
</context>
<context>
- <name>QApplication</name>
+ <name>QGuiApplication</name>
<message>
<source>QT_LAYOUT_DIRECTION</source>
<comment>Translate this to LTR for left-to-right or RTL for right-to-left languages</comment>
diff --git a/Swift/Translations/swift_nl.ts b/Swift/Translations/swift_nl.ts
index 3134e65..2686e5e 100644
--- a/Swift/Translations/swift_nl.ts
+++ b/Swift/Translations/swift_nl.ts
@@ -695,7 +695,7 @@
</message>
</context>
<context>
- <name>QApplication</name>
+ <name>QGuiApplication</name>
<message>
<source>QT_LAYOUT_DIRECTION</source>
<comment>Translate this to LTR for left-to-right or RTL for right-to-left languages</comment>
diff --git a/Swift/Translations/swift_pl.ts b/Swift/Translations/swift_pl.ts
index cc461a1..838725e 100644
--- a/Swift/Translations/swift_pl.ts
+++ b/Swift/Translations/swift_pl.ts
@@ -573,7 +573,7 @@
</message>
</context>
<context>
- <name>QApplication</name>
+ <name>QGuiApplication</name>
<message>
<location filename="../QtUI/QtStrings.h" line="19"/>
<source>QT_LAYOUT_DIRECTION</source>
diff --git a/Swift/Translations/swift_ru.ts b/Swift/Translations/swift_ru.ts
index 56069a5..08492f7 100644
--- a/Swift/Translations/swift_ru.ts
+++ b/Swift/Translations/swift_ru.ts
@@ -695,7 +695,7 @@
</message>
</context>
<context>
- <name>QApplication</name>
+ <name>QGuiApplication</name>
<message>
<location filename="../QtUI/QtStrings.h" line="19"/>
<source>QT_LAYOUT_DIRECTION</source>
diff --git a/Swift/Translations/swift_sk.ts b/Swift/Translations/swift_sk.ts
index e99a638..77db4f8 100644
--- a/Swift/Translations/swift_sk.ts
+++ b/Swift/Translations/swift_sk.ts
@@ -698,7 +698,7 @@
</message>
</context>
<context>
- <name>QApplication</name>
+ <name>QGuiApplication</name>
<message>
<location filename="../QtUI/QtStrings.h" line="19"/>
<source>QT_LAYOUT_DIRECTION</source>
diff --git a/Swift/Translations/swift_sv.ts b/Swift/Translations/swift_sv.ts
index b979dab..6aedfb8 100644
--- a/Swift/Translations/swift_sv.ts
+++ b/Swift/Translations/swift_sv.ts
@@ -580,7 +580,7 @@
</message>
</context>
<context>
- <name>QApplication</name>
+ <name>QGuiApplication</name>
<message>
<location filename="../QtUI/QtStrings.h" line="19"/>
<source>QT_LAYOUT_DIRECTION</source>