From f30fcc56b2d48a568da758d7508f94910c6f40c6 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Sun, 16 Dec 2018 21:19:29 -0500 Subject: 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 --- app/Dashboard.qml | 28 +++++++++++++++++++++------- 1 file 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 } } } -- cgit 1.2.3-korg