From 98ab4ea2aab7e680d8fa96f836c7d15c659ea082 Mon Sep 17 00:00:00 2001 From: selsta Date: Sun, 8 Dec 2019 22:06:31 +0100 Subject: [PATCH] misc: strip html out of translatable strings --- main.qml | 6 +++--- pages/AddressBook.qml | 8 ++++---- pages/Transfer.qml | 8 ++++---- pages/merchant/Merchant.qml | 12 ++++-------- pages/settings/SettingsInfo.qml | 2 +- pages/settings/SettingsNode.qml | 2 +- wizard/WizardAskPassword.qml | 2 +- 7 files changed, 18 insertions(+), 22 deletions(-) diff --git a/main.qml b/main.qml index f97a2732..d7e838ae 100644 --- a/main.qml +++ b/main.qml @@ -1982,11 +1982,11 @@ ApplicationWindow { var version = parts[0] var hash = parts[1] var user_url = parts[2] - var msg = "" + var msg = qsTr("New version of Monero v%1 is available.").arg(version) if (isMac || isWindows || isLinux) { - msg = qsTr("New version of Monero v%1 is available.

Download:
%2

SHA256 Hash:
%3").arg(version).arg(user_url).arg(hash) + translationManager.emptyString + msg += "

%1:
%2

%3:
%4".arg(qsTr("Download")).arg(user_url).arg(qsTr("SHA256 Hash")).arg(hash) + translationManager.emptyString } else { - msg = qsTr("New version of Monero v%1 is available. Check out getmonero.org").arg(version) + translationManager.emptyString + msg += " " + qsTr("Check out getmonero.org") + translationManager.emptyString } notifier.show(msg) } else { diff --git a/pages/AddressBook.qml b/pages/AddressBook.qml index caaf9d5d..fef61bc3 100644 --- a/pages/AddressBook.qml +++ b/pages/AddressBook.qml @@ -306,8 +306,8 @@ Rectangle { MoneroComponents.LineEditMulti { id: addressLine Layout.topMargin: 20 - labelText: qsTr("\ - Address") + translationManager.emptyString + labelText: " %1" + .arg(qsTr("Address")) + translationManager.emptyString placeholderText: { if(persistentSettings.nettype == NetworkType.MAINNET){ return "4.. / 8.. / OpenAlias"; @@ -384,8 +384,8 @@ Rectangle { MoneroComponents.LineEditMulti { id: descriptionLine Layout.topMargin: 20 - labelText: qsTr("\ - Description") + translationManager.emptyString + labelText: " %1" + .arg(qsTr("Description")) + translationManager.emptyString placeholderText: qsTr("Add a name...") + translationManager.emptyString } RowLayout { diff --git a/pages/Transfer.qml b/pages/Transfer.qml index 950a0e3f..bc1ff78b 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -78,7 +78,7 @@ Rectangle { return ""; } - property string startLinkText: qsTr(" (Start daemon)") + translationManager.emptyString + property string startLinkText: "(%1)".arg(qsTr("Start daemon")) + translationManager.emptyString property bool warningLongPidDescription: descriptionLine.text.match(/^[0-9a-f]{64}$/i) Clipboard { id: clipboard } @@ -176,8 +176,8 @@ Rectangle { id: amountLine Layout.fillWidth: true inlineIcon: true - labelText: qsTr("\ - Amount ( Change account )") + labelText: "\ + %1 (%2)".arg(qsTr("Amount")).arg(qsTr("Change account")) + translationManager.emptyString copyButton: !isNaN(amountLine.text) && persistentSettings.fiatPriceEnabled copyButtonText: fiatApiCurrencySymbol() + " ~" + fiatApiConvertToFiat(amountLine.text) @@ -262,7 +262,7 @@ Rectangle { spacing: 0 fontBold: true labelText: qsTr("\ - Address ( Address book )") + %1 (%2)").arg(qsTr("Address")).arg(qsTr("Address book")) + translationManager.emptyString labelButtonText: qsTr("Resolve") + translationManager.emptyString placeholderText: { diff --git a/pages/merchant/Merchant.qml b/pages/merchant/Merchant.qml index 99eddfcf..750ff2aa 100644 --- a/pages/merchant/Merchant.qml +++ b/pages/merchant/Merchant.qml @@ -151,14 +151,10 @@ Item { model: trackingModel message: { if(!root.enableTracking){ - return qsTr( - "" + - "

This page will automatically scan the blockchain and the tx pool " + - "for incoming transactions using the QR code.

" + - "

It's up to you whether to accept unconfirmed transactions or not. It is likely they'll be " + - "confirmed in short order, but there is still a possibility they might not, so for larger " + - "values you may want to wait for one or more confirmation(s).

" - ) + translationManager.emptyString; + return "

%1

%2

" + .arg(qsTr("This page will automatically scan the blockchain and the tx pool for incoming transactions using the QR code.")) + .arg(qsTr("It's up to you whether to accept unconfirmed transactions or not. It is likely they'll be confirmed in short order, but there is still a possibility they might not, so for larger values you may want to wait for one or more confirmation(s)")) + + translationManager.emptyString; } else if(root.trackingError !== ""){ return root.trackingError; } else if(trackingModel.count < 1){ diff --git a/pages/settings/SettingsInfo.qml b/pages/settings/SettingsInfo.qml index 91b301ff..84d066e7 100644 --- a/pages/settings/SettingsInfo.qml +++ b/pages/settings/SettingsInfo.qml @@ -182,7 +182,7 @@ Rectangle { color: MoneroComponents.Style.dimmedFontColor font.pixelSize: 14 property var style: "" - text: (currentWallet ? currentWallet.walletCreationHeight : "") + style + qsTr(" (Click to change)") + translationManager.emptyString + text: (currentWallet ? currentWallet.walletCreationHeight : "") + style + " (%1)".arg(qsTr("Change")) + translationManager.emptyString onLinkActivated: { inputDialog.labelText = qsTr("Set a new restore height.\nYou can enter a block height or a date (YYYY-MM-DD):") + translationManager.emptyString; inputDialog.onAcceptedCallback = function() { diff --git a/pages/settings/SettingsNode.qml b/pages/settings/SettingsNode.qml index 5ca4d320..e00cb849 100644 --- a/pages/settings/SettingsNode.qml +++ b/pages/settings/SettingsNode.qml @@ -381,7 +381,7 @@ Rectangle{ fontSize: 15 labelFontSize: 14 property string style: "" - labelText: qsTr("Blockchain location") + style + qsTr(" (change)") + translationManager.emptyString + labelText: qsTr("Blockchain location") + style + " (%1)".arg(qsTr("Change")) + translationManager.emptyString placeholderText: qsTr("(default)") + translationManager.emptyString placeholderFontSize: 15 readOnly: true diff --git a/wizard/WizardAskPassword.qml b/wizard/WizardAskPassword.qml index c2a3e5c0..6aac90ed 100644 --- a/wizard/WizardAskPassword.qml +++ b/wizard/WizardAskPassword.qml @@ -87,7 +87,7 @@ ColumnLayout { } MoneroComponents.WarningBox { - text: qsTr("Enter a strong password (Using letters, numbers, and/or symbols).") + translationManager.emptyString + text: "%1 (%2).".arg(qsTr("Enter a strong password")).arg(qsTr("Using letters, numbers, and/or symbols")) + translationManager.emptyString } ColumnLayout {