summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2018-12-16 21:19:29 -0500
committerScott Murray <scott.murray@konsulko.com>2018-12-18 13:38:26 -0500
commita6aa079ea69a0fd429460020bb80e842cf0cc4bf (patch)
treead12f28021631ff1adc2dd573e089bde68a9cd48
parent67093a2a607043a0a7701846f56250677363624b (diff)
Fix language selection buttons
Hand-applied snippet from commit: 96654f5 change translate text on branch sandbox/zheng_wenlong/ces2019_vertical to fix the rendering of the language buttons and prettify them by using the language name rather than underlying locale name as the buttone text. Change-Id: Ic852ecc7844e47c8e04da1907f3d843a15bb63ab Signed-off-by: Scott Murray <scott.murray@konsulko.com> (cherry picked from commit f30fcc56b2d48a568da758d7508f94910c6f40c6)
-rw-r--r--app/Dashboard.qml28
1 files changed, 21 insertions, 7 deletions
diff --git a/app/Dashboard.qml b/app/Dashboard.qml
index 496062b..2c23fb0 100644
--- a/app/Dashboard.qml
+++ b/app/Dashboard.qml
@@ -279,20 +279,34 @@ ApplicationWindow {
}
RowLayout {
-// visible: false
- anchors.left: parent.left
anchors.bottom: parent.bottom
- anchors.right: parent.right
+ anchors.horizontalCenter: parent.horizontalCenter
Repeater {
- model: ['C', 'fr_FR', 'ja_JP', 'zh_CN']
+ model: ListModel {
+ ListElement {
+ code: 'C'
+ language: QT_TR_NOOP('English')
+ }
+ ListElement {
+ code: 'fr_FR'
+ language: QT_TR_NOOP('Français')
+ }
+ ListElement {
+ code: 'ja_JP'
+ language: QT_TR_NOOP('日本語')
+ }
+ ListElement {
+ code: 'zh_CN'
+ language: QT_TR_NOOP('中文简体')
+ }
+ }
Button {
- text: model.modelData
+ text: qsTr(model.language)
onClicked: {
- translator.language = model.modelData
+ translator.language = model.code
console.log ("Scale = " + screenInfo.scale_factor())
}
- Layout.fillWidth: true
}
}
}