diff options
author | Scott Murray <scott.murray@konsulko.com> | 2018-12-16 21:19:29 -0500 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2018-12-16 21:22:57 -0500 |
commit | f30fcc56b2d48a568da758d7508f94910c6f40c6 (patch) | |
tree | 107c11e3b195eba9912b1b9c8a53180e4950d91a /app | |
parent | 60a20cc4d0fc101b985cf56f172c908d9a2b0a27 (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>
Diffstat (limited to 'app')
-rw-r--r-- | app/Dashboard.qml | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/app/Dashboard.qml b/app/Dashboard.qml index 496062b..882b63a 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('French') + } + 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 } } } |