Skip to content

Commit 1868300

Browse files
committed
Support RTL languages
Translator will need to translate the QT_LAYOUT_DIRECTION string and we will need to run the following command to update the translation files: lupdate-qt5 ../../components/common/TextConstants.qml ../../src/greeter -ts <lang>.ts SDDM now relies on that string to contain "RTL" (without quotes) in order to set the right-to-left layout direction. All the themes were also updated to enable layout mirroring for right-to-left languages. Third party themes will need to do the same to honor the RTL setting. Closes #329
1 parent 6f87606 commit 1868300

File tree

26 files changed

+201
-17
lines changed

26 files changed

+201
-17
lines changed

components/2.0/ComboBox.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ FocusScope {
4646
id: defaultRowDelegate
4747
Text {
4848
anchors.fill: parent
49-
anchors.margins: 4
49+
anchors.margins: 4 + (Qt.application.layoutDirection == Qt.RightToLeft ? arrow.width : 0)
5050
verticalAlignment: Text.AlignVCenter
5151
font: container.font
5252

data/themes/circles/Main.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ Rectangle {
3030
width: 640
3131
height: 480
3232

33+
LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
34+
LayoutMirroring.childrenInherit: true
35+
3336
TextConstants { id: textConstants }
3437

3538
Connections {

data/themes/elarun/Main.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ Rectangle {
3030
width: 640
3131
height: 480
3232

33+
LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
34+
LayoutMirroring.childrenInherit: true
35+
3336
TextConstants { id: textConstants }
3437

3538
Connections {

data/themes/maldives/Main.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ Rectangle {
3030
width: 640
3131
height: 480
3232

33+
LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
34+
LayoutMirroring.childrenInherit: true
35+
3336
TextConstants { id: textConstants }
3437

3538
Connections {

data/themes/maui/Main.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ Rectangle {
3131
width: 1024
3232
height: 768
3333

34+
LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
35+
LayoutMirroring.childrenInherit: true
36+
3437
property int sessionIndex: session.index
3538

3639
TextConstants { id: textConstants }

data/translations/ar.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!DOCTYPE TS>
33
<TS version="2.1" language="ar">
4+
<context>
5+
<name>QGuiApplication</name>
6+
<message>
7+
<source>QT_LAYOUT_DIRECTION</source>
8+
<comment>Translate this string to the string &apos;LTR&apos; in left-to-right languages or to &apos;RTL&apos; in right-to-left languages (such as Hebrew and Arabic) to get proper layout direction in SDDM themes that supports it</comment>
9+
<translation>RTL</translation>
10+
</message>
11+
</context>
412
<context>
513
<name>TextConstants</name>
614
<message>

data/translations/cs.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!DOCTYPE TS>
3-
<TS version="2.0" language="cs">
3+
<TS version="2.1" language="cs">
4+
<context>
5+
<name>QGuiApplication</name>
6+
<message>
7+
<source>QT_LAYOUT_DIRECTION</source>
8+
<comment>Translate this string to the string &apos;LTR&apos; in left-to-right languages or to &apos;RTL&apos; in right-to-left languages (such as Hebrew and Arabic) to get proper layout direction in SDDM themes that supports it</comment>
9+
<translation type="unfinished"></translation>
10+
</message>
11+
</context>
412
<context>
513
<name>TextConstants</name>
614
<message>

data/translations/de.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!DOCTYPE TS>
3-
<TS version="2.0" language="de">
3+
<TS version="2.1" language="de">
4+
<context>
5+
<name>QGuiApplication</name>
6+
<message>
7+
<source>QT_LAYOUT_DIRECTION</source>
8+
<comment>Translate this string to the string &apos;LTR&apos; in left-to-right languages or to &apos;RTL&apos; in right-to-left languages (such as Hebrew and Arabic) to get proper layout direction in SDDM themes that supports it</comment>
9+
<translation type="unfinished"></translation>
10+
</message>
11+
</context>
412
<context>
513
<name>TextConstants</name>
614
<message>

data/translations/es.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!DOCTYPE TS>
3-
<TS version="2.0" language="es">
3+
<TS version="2.1" language="es">
4+
<context>
5+
<name>QGuiApplication</name>
6+
<message>
7+
<source>QT_LAYOUT_DIRECTION</source>
8+
<comment>Translate this string to the string &apos;LTR&apos; in left-to-right languages or to &apos;RTL&apos; in right-to-left languages (such as Hebrew and Arabic) to get proper layout direction in SDDM themes that supports it</comment>
9+
<translation type="unfinished"></translation>
10+
</message>
11+
</context>
412
<context>
513
<name>TextConstants</name>
614
<message>

data/translations/et.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!DOCTYPE TS>
33
<TS version="2.1" language="et">
4+
<context>
5+
<name>QGuiApplication</name>
6+
<message>
7+
<source>QT_LAYOUT_DIRECTION</source>
8+
<comment>Translate this string to the string &apos;LTR&apos; in left-to-right languages or to &apos;RTL&apos; in right-to-left languages (such as Hebrew and Arabic) to get proper layout direction in SDDM themes that supports it</comment>
9+
<translation type="unfinished"></translation>
10+
</message>
11+
</context>
412
<context>
513
<name>TextConstants</name>
614
<message>

0 commit comments

Comments
 (0)