translations: update qsTrs to Translation.tr and allow translation of notifications

This commit is contained in:
end-4
2025-07-17 13:56:50 +07:00
parent 9ca67f0095
commit 1e7c84a6c1
10 changed files with 104 additions and 41 deletions
@@ -99,7 +99,11 @@ ColumnLayout {
Quickshell.execDetached(["bash", "-c",
`echo '${StringUtils.shellSingleQuoteEscape(segmentContent)}' > '${downloadPath}/code.${segmentLang || "txt"}'`
])
Quickshell.execDetached(["bash", "-c", `notify-send 'Code saved to file' '${downloadPath}/code.${segmentLang || "txt"}' -a Shell`])
Quickshell.execDetached(["notify-send",
Translation.tr("Code saved to file"),
Translation.tr("Saved to %1").arg(`${downloadPath}/code.${segmentLang || "txt"}`),
"-a", "Shell"
])
saveCodeButton.activated = true
saveIconTimer.restart()
}
@@ -181,7 +181,7 @@ Button {
onClicked: {
root.showActions = false
Quickshell.execDetached(["bash", "-c",
`curl '${root.imageData.file_url}' -o '${root.imageData.is_nsfw ? root.nsfwPath : root.downloadPath}/${root.fileName}' && notify-send '${qsTr("Download complete")}' '${root.downloadPath}/${root.fileName}' -a 'Shell'`
`curl '${root.imageData.file_url}' -o '${root.imageData.is_nsfw ? root.nsfwPath : root.downloadPath}/${root.fileName}' && notify-send '${Translation.tr("Download complete")}' '${root.downloadPath}/${root.fileName}' -a 'Shell'`
])
}
}