dynamic translation support. closes #24

This commit is contained in:
Ilya Kitaev
2016-07-20 22:28:11 +03:00
parent 39b88daf32
commit 32ebf180ac
34 changed files with 837 additions and 314 deletions

View File

@@ -76,7 +76,7 @@ Item {
wrapMode: Text.Wrap
//renderType: Text.NativeRendering
color: "#3F3F3F"
text: qsTr("Were almost there - lets just configure some Monero preferences")
text: qsTr("Were almost there - lets just configure some Monero preferences") + translationManager.emptyString
}
Column {
@@ -94,7 +94,7 @@ Item {
spacing: 12
CheckBox {
text: qsTr("Kickstart the Monero blockchain?")
text: qsTr("Kickstart the Monero blockchain?") + translationManager.emptyString
anchors.left: parent.left
anchors.right: parent.right
background: "#F0EEEE"
@@ -114,6 +114,7 @@ Item {
wrapMode: Text.Wrap
text: qsTr("It is very important to write it down as this is the only backup you will need for your wallet. " +
"You will be asked to confirm the seed in the next screen to ensure it has copied down correctly.")
+ translationManager.emptyString
}
}
@@ -123,7 +124,7 @@ Item {
spacing: 12
CheckBox {
text: qsTr("Enable disk conservation mode?")
text: qsTr("Enable disk conservation mode?") + translationManager.emptyString
anchors.left: parent.left
anchors.right: parent.right
background: "#F0EEEE"
@@ -144,6 +145,7 @@ Item {
text: qsTr("Disk conservation mode uses substantially less disk-space, but the same amount of bandwidth as " +
"a regular Monero instance. However, storing the full blockchain is beneficial to the security " +
"of the Monero network. If you are on a device with limited disk space, then this option is appropriate for you.")
+ translationManager.emptyString
}
}
@@ -153,7 +155,7 @@ Item {
spacing: 12
CheckBox {
text: qsTr("Allow background mining?")
text: qsTr("Allow background mining?") + translationManager.emptyString
anchors.left: parent.left
anchors.right: parent.right
background: "#F0EEEE"
@@ -173,6 +175,7 @@ Item {
wrapMode: Text.Wrap
text: qsTr("Mining secures the Monero network, and also pays a small reward for the work done. This option " +
"will let Monero mine when your computer is on mains power and is idle. It will stop mining when you continue working.")
+ translationManager.emptyString
}
}
}

View File

@@ -78,8 +78,8 @@ Item {
WizardManageWalletUI {
id: uiItem
titleText: qsTr("A new wallet has been created for you")
wordsTextTitle: qsTr("This is the 25 word mnemonic for your wallet")
titleText: qsTr("A new wallet has been created for you") + translationManager.emptyString
wordsTextTitle: qsTr("This is the 25 word mnemonic for your wallet") + translationManager.emptyString
wordsTextItem.clipboardButtonVisible: true
wordsTextItem.tipTextVisible: true
wordsTextItem.memoTextReadOnly: true

View File

@@ -90,7 +90,7 @@ Item {
wrapMode: Text.Wrap
//renderType: Text.NativeRendering
color: "#3F3F3F"
text: qsTr("Monero development is solely supported by donations")
text: qsTr("Monero development is solely supported by donations") + translationManager.emptyString
}
Column {
@@ -110,7 +110,7 @@ Item {
CheckBox {
id: enableAutoDonationCheckBox
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Enable auto-donations of?")
text: qsTr("Enable auto-donations of?") + translationManager.emptyString
background: "#F0EEEE"
fontColor: "#4A4646"
fontSize: 18
@@ -150,7 +150,7 @@ Item {
font.family: "Arial"
font.pixelSize: 18
color: "#4A4646"
text: qsTr("% of my fee added to each transaction")
text: qsTr("% of my fee added to each transaction") + translationManager.emptyString
}
}
@@ -164,6 +164,7 @@ Item {
text: qsTr("For every transaction, a small transaction fee is charged. This option lets you add an additional amount, " +
"as a percentage of that fee, to your transaction to support Monero development. For instance, a 50% " +
"autodonation take a transaction fee of 0.005 XMR and add a 0.0025 XMR to support Monero development.")
+ translationManager.emptyString
}
Column {
anchors.left: parent.left
@@ -172,7 +173,7 @@ Item {
CheckBox {
id: allowBackgroundMiningCheckBox
text: qsTr("Allow background mining?")
text: qsTr("Allow background mining?") + translationManager.emptyString
anchors.left: parent.left
anchors.right: parent.right
background: "#F0EEEE"
@@ -192,6 +193,7 @@ Item {
wrapMode: Text.Wrap
text: qsTr("Mining secures the Monero network, and also pays a small reward for the work done. This option " +
"will let Monero mine when your computer is on mains power and is idle. It will stop mining when you continue working.")
+ translationManager.emptyString
}
}
}

View File

@@ -45,10 +45,11 @@ Item {
+ qsTr("<b>Enable auto donation: </b>") + wizard.settings['auto_donations_enabled'] + "<br>"
+ qsTr("<b>Auto donation amount: </b>") + wizard.settings['auto_donations_amount'] + "<br>"
+ qsTr("<b>Allow background mining: </b>") + wizard.settings['allow_background_mining'] + "<br>"
+ translationManager.emptyString
return str;
}
function updateSettingsSummary() {
settingsText.text = qsTr("An overview of your Monero configuration is below:")
settingsText.text = qsTr("An overview of your Monero configuration is below:") + translationManager.emptyString
+ "<br>"
+ buildSettingsString();
}
@@ -99,7 +100,7 @@ Item {
horizontalAlignment: Text.AlignHCenter
//renderType: Text.NativeRendering
color: "#3F3F3F"
text: qsTr("Youre all setup!")
text: qsTr("Youre all setup!") + translationManager.emptyString
}
Text {

View File

@@ -82,9 +82,9 @@ Rectangle {
// disable "next" button until passwords match
nextButton.enabled = passwordPage.passwordValid;
if (currentPath === "create_wallet") {
passwordPage.titleText = qsTr("Now that your wallet has been created, please set a password for the wallet")
passwordPage.titleText = qsTr("Now that your wallet has been created, please set a password for the wallet") + translationManager.emptyString
} else {
passwordPage.titleText = qsTr("Now that your wallet has been restored, please set a password for the wallet")
passwordPage.titleText = qsTr("Now that your wallet has been restored, please set a password for the wallet") + translationManager.emptyString
}
break;
case finishPage:
@@ -306,7 +306,7 @@ Rectangle {
anchors.bottom: parent.bottom
anchors.margins: 50
width: 110
text: qsTr("USE MONERO")
text: qsTr("USE MONERO") + translationManager.emptyString
shadowReleasedColor: "#FF4304"
shadowPressedColor: "#B32D00"
releasedColor: "#FF6C3C"

View File

@@ -100,7 +100,7 @@ Item {
horizontalAlignment: Text.AlignHCenter
//renderType: Text.NativeRendering
color: "#4A4646"
text: qsTr("This is the name of your wallet. You can change it to a different name if youd like:")
text: qsTr("This is the name of your wallet. You can change it to a different name if youd like:") + translationManager.emptyString
}
}
@@ -122,7 +122,7 @@ Item {
renderType: Text.NativeRendering
color: "#FF6C3C"
focus: true
text: qsTr("My account name")
text: qsTr("My account name") + translationManager.emptyString
}
Rectangle {
@@ -172,7 +172,7 @@ Item {
font.pixelSize: 18
//renderType: Text.NativeRendering
color: "#4A4646"
text: qsTr("Your wallet is stored in")
text: qsTr("Your wallet is stored in") + translationManager.emptyString
}
Item {
@@ -184,7 +184,7 @@ Item {
id: fileDialog
selectMultiple: false
selectFolder: true
title: "Please choose a directory"
title: qsTr("Please choose a directory") + translationManager.emptyString
onAccepted: {
fileUrlInput.text = fileDialog.folder
fileDialog.visible = false

View File

@@ -74,6 +74,7 @@ Column {
color: "#4A4646"
wrapMode: Text.Wrap
text: qsTr("It is very important to write it down as this is the only backup you will need for your wallet. You will be asked to confirm the seed in the next screen to ensure it has copied down correctly.")
+ translationManager.emptyString
}
}
}

View File

@@ -59,7 +59,7 @@ Item {
color: "#3F3F3F"
wrapMode: Text.Wrap
horizontalAlignment: Text.AlignHCenter
text: qsTr("Welcome to Monero!")
text: qsTr("Welcome to Monero!") + translationManager.emptyString
}
Text {
@@ -71,7 +71,7 @@ Item {
color: "#4A4646"
wrapMode: Text.Wrap
horizontalAlignment: Text.AlignHCenter
text: qsTr("Please select one of the following options:")
text: qsTr("Please select one of the following options:") + translationManager.emptyString
}
}
@@ -107,7 +107,7 @@ Item {
font.pixelSize: 16
color: "#4A4949"
horizontalAlignment: Text.AlignHCenter
text: qsTr("This is my first time, I want to<br/>create a new account")
text: qsTr("This is my first time, I want to<br/>create a new account") + translationManager.emptyString
}
}
@@ -138,7 +138,7 @@ Item {
font.pixelSize: 16
color: "#4A4949"
horizontalAlignment: Text.AlignHCenter
text: qsTr("I want to recover my account<br/>from my 24 work seed")
text: qsTr("I want to recover my account<br/>from my 24 work seed") + translationManager.emptyString
}
}
}

View File

@@ -120,6 +120,7 @@ Item {
horizontalAlignment: Text.AlignHCenter
text: qsTr("Note that this password cannot be recovered, and if forgotten you will need to restore your wallet from the mnemonic seed you were just given<br/><br/>
Your password will be used to protect your wallet and to confirm actions, so make sure that your password is sufficiently secure.")
+ translationManager.emptyString
}
}

View File

@@ -66,9 +66,9 @@ Item {
WizardManageWalletUI {
id: uiItem
accountNameText: qsTr("My account name")
titleText: qsTr("We're ready to recover your account")
wordsTextTitle: qsTr("Please enter your 25 word private key")
accountNameText: qsTr("My account name") + translationManager.emptyString
titleText: qsTr("We're ready to recover your account") + translationManager.emptyString
wordsTextTitle: qsTr("Please enter your 25 word private key") + translationManager.emptyString
wordsTextItem.clipboardButtonVisible: false
wordsTextItem.tipTextVisible: false
wordsTextItem.memoTextReadOnly: false

View File

@@ -37,3 +37,8 @@ function mapScope (inputScopeFrom, inputScopeTo, outputScopeFrom, outputScopeTo,
var result = outputScopeFrom + ((outputScopeTo - outputScopeFrom) * x);
return result;
}
function tr(text) {
return qsTr(text) + translationManager.emptyString
}