Skip to content
Snippets Groups Projects
Commit 38e4c22d authored by akiraohgaki's avatar akiraohgaki
Browse files

Make labels translatable

parent 421eae01
No related branches found
No related tags found
No related merge requests found
...@@ -91,7 +91,7 @@ Window { ...@@ -91,7 +91,7 @@ Window {
} }
Button { Button {
id: cancelButton id: cancelButton
text: "Cancel" text: qsTr("Cancel")
anchors.right: parent.right anchors.right: parent.right
onClicked: Qt.quit() onClicked: Qt.quit()
} }
...@@ -102,12 +102,12 @@ Window { ...@@ -102,12 +102,12 @@ Window {
Component.onCompleted: { Component.onCompleted: {
var metadata = xdgUrlHandler.metadata(); var metadata = xdgUrlHandler.metadata();
var primaryMessages = { var primaryMessages = {
"success_download": "Download successfull", "success_download": qsTr("Download successfull"),
"success_install": "Installation successfull", "success_install": qsTr("Installation successfull"),
"error_validation": "Validation error", "error_validation": qsTr("Validation error"),
"error_network": "Network error", "error_network": qsTr("Network error"),
"error_save": "Saving file failed", "error_save": qsTr("Saving file failed"),
"error_install": "Installation failed" "error_install": qsTr("Installation failed")
}; };
xdgUrlHandler.started.connect(function() { xdgUrlHandler.started.connect(function() {
...@@ -131,7 +131,7 @@ Window { ...@@ -131,7 +131,7 @@ Window {
}); });
xdgUrlHandler.downloadProgress.connect(function(id, bytesReceived, bytesTotal) { xdgUrlHandler.downloadProgress.connect(function(id, bytesReceived, bytesTotal) {
progressDialog.primaryLabel.text = "Downloading... "; progressDialog.primaryLabel.text = qsTr("Downloading");
progressDialog.informativeLabel.text = metadata.filename; progressDialog.informativeLabel.text = metadata.filename;
progressDialog.progressBar.value = bytesReceived / bytesTotal; progressDialog.progressBar.value = bytesReceived / bytesTotal;
progressDialog.progressLabel.text = Utility.convertByteToHumanReadable(bytesReceived) progressDialog.progressLabel.text = Utility.convertByteToHumanReadable(bytesReceived)
...@@ -139,16 +139,21 @@ Window { ...@@ -139,16 +139,21 @@ Window {
}); });
if (xdgUrlHandler.isValid()) { if (xdgUrlHandler.isValid()) {
confirmDialog.text = "Do you want to " + metadata.command + "?"; if (metadata.command === "download") {
confirmDialog.text = qsTr("Do you want to download?");
}
else if (metadata.command === "install") {
confirmDialog.text = qsTr("Do you want to install?");
}
confirmDialog.informativeText = metadata.filename; confirmDialog.informativeText = metadata.filename;
confirmDialog.detailedText = "URL: " + metadata.url + "\n\n" confirmDialog.detailedText = qsTr("URL") + ": " + metadata.url + "\n\n"
+ "File: " + metadata.filename + "\n\n" + qsTr("File") + ": " + metadata.filename + "\n\n"
+ "Type: " + metadata.type; + qsTr("Type") + ": " + metadata.type;
confirmDialog.open(); confirmDialog.open();
} }
else { else {
errorDialog.text = "Validation error"; errorDialog.text = qsTr("Validation error");
errorDialog.detailedText = "Invalid XDG-URL " + xdgUrlHandler.xdgUrl(); errorDialog.detailedText = qsTr("Invalid XDG-URL") + " " + xdgUrlHandler.xdgUrl();
errorDialog.open(); errorDialog.open();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment