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 {
}
Button {
id: cancelButton
text: "Cancel"
text: qsTr("Cancel")
anchors.right: parent.right
onClicked: Qt.quit()
}
......@@ -102,12 +102,12 @@ Window {
Component.onCompleted: {
var metadata = xdgUrlHandler.metadata();
var primaryMessages = {
"success_download": "Download successfull",
"success_install": "Installation successfull",
"error_validation": "Validation error",
"error_network": "Network error",
"error_save": "Saving file failed",
"error_install": "Installation failed"
"success_download": qsTr("Download successfull"),
"success_install": qsTr("Installation successfull"),
"error_validation": qsTr("Validation error"),
"error_network": qsTr("Network error"),
"error_save": qsTr("Saving file failed"),
"error_install": qsTr("Installation failed")
};
xdgUrlHandler.started.connect(function() {
......@@ -131,7 +131,7 @@ Window {
});
xdgUrlHandler.downloadProgress.connect(function(id, bytesReceived, bytesTotal) {
progressDialog.primaryLabel.text = "Downloading... ";
progressDialog.primaryLabel.text = qsTr("Downloading");
progressDialog.informativeLabel.text = metadata.filename;
progressDialog.progressBar.value = bytesReceived / bytesTotal;
progressDialog.progressLabel.text = Utility.convertByteToHumanReadable(bytesReceived)
......@@ -139,16 +139,21 @@ Window {
});
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.detailedText = "URL: " + metadata.url + "\n\n"
+ "File: " + metadata.filename + "\n\n"
+ "Type: " + metadata.type;
confirmDialog.detailedText = qsTr("URL") + ": " + metadata.url + "\n\n"
+ qsTr("File") + ": " + metadata.filename + "\n\n"
+ qsTr("Type") + ": " + metadata.type;
confirmDialog.open();
}
else {
errorDialog.text = "Validation error";
errorDialog.detailedText = "Invalid XDG-URL " + xdgUrlHandler.xdgUrl();
errorDialog.text = qsTr("Validation error");
errorDialog.detailedText = qsTr("Invalid XDG-URL") + " " + xdgUrlHandler.xdgUrl();
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