From 4c2f78a78be7103c5aa3eb149d9235ad34298d80 Mon Sep 17 00:00:00 2001 From: Jaquee Date: Thu, 9 Mar 2017 16:46:03 +0100 Subject: [PATCH] Fix translations in dropdown menu --- components/StandardDropdown.qml | 12 +++++++++--- main.qml | 3 +++ pages/Transfer.qml | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/components/StandardDropdown.qml b/components/StandardDropdown.qml index b3820501..8b2c9d41 100644 --- a/components/StandardDropdown.qml +++ b/components/StandardDropdown.qml @@ -107,7 +107,7 @@ Item { font.bold: true font.pixelSize: 12 color: "#FFFFFF" - text: column.currentIndex < repeater.model.rowCount() ? repeater.model.get(column.currentIndex).column1 : "" + text: column.currentIndex < repeater.model.rowCount() ? qsTr(repeater.model.get(column.currentIndex).column1) + translationManager.emptyString : "" } Text { @@ -119,7 +119,7 @@ Item { font.family: "Arial" font.pixelSize: 12 color: "#FFFFFF" - text: column.currentIndex < repeater.model.rowCount() ? repeater.model.get(column.currentIndex).column2 : "" + text: column.currentIndex < repeater.model.rowCount() ? qsTr(repeater.model.get(column.currentIndex).column2) + translationManager.emptyString : "" property int w: 0 Component.onCompleted: w = implicitWidth @@ -193,6 +193,12 @@ Item { Repeater { id: repeater + // Workaround for translations in listElements. All translated strings needs to be listed in this file. + property string stringLow: qsTr("Low (x1 fee)") + translationManager.emptyString + property string stringMedium: qsTr("Medium (x20 fee)") + translationManager.emptyString + property string stringHigh: qsTr("High (x166 fee)") + translationManager.emptyString + + delegate: Rectangle { anchors.left: parent.left anchors.right: parent.right @@ -210,7 +216,7 @@ Item { font.bold: true font.pixelSize: 12 color: "#FFFFFF" - text: column1 + text: qsTr(column1) + translationManager.emptyString } Text { diff --git a/main.qml b/main.qml index 9b0ebd51..6432803f 100644 --- a/main.qml +++ b/main.qml @@ -178,6 +178,9 @@ ApplicationWindow { translationManager.setLanguage(locale.split("_")[0]); } + // Reload transfer page with translations enabled + middlePanel.transferView.onPageCompleted(); + // If currentWallet exists, we're just switching daemon - close/reopen wallet if (typeof currentWallet !== "undefined" && currentWallet !== null) { console.log("Daemon change - closing " + currentWallet) diff --git a/pages/Transfer.qml b/pages/Transfer.qml index 84542148..8ddbd727 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -688,13 +688,13 @@ Rectangle { Component.onCompleted: { //Disable password page until enabled by updateStatus pageRoot.enabled = false - updateMixin() } // fires on every page load function onPageCompleted() { console.log("transfer page loaded") updateStatus(); + updateMixin(); } //TODO: Add daemon sync status