i18n: Refactor string formatting to use arg() method for translations

This commit is contained in:
月月
2025-07-16 21:11:27 +08:00
parent b98e843a9d
commit 2ad60a40a8
11 changed files with 85 additions and 72 deletions
@@ -165,7 +165,7 @@ Button {
id: sourceButton
visible: root.imageData.source && root.imageData.source.length > 0
Layout.fillWidth: true
buttonText: StringUtils.format(Translation.tr("Go to source ({0})"), StringUtils.getDomain(root.imageData.source))
buttonText: Translation.tr("Go to source (%1)").arg(StringUtils.getDomain(root.imageData.source))
enabled: root.imageData.source && root.imageData.source.length > 0
onClicked: {
root.showActions = false
@@ -95,7 +95,7 @@ Rectangle {
font.pixelSize: Appearance.font.pixelSize.smaller
color: Appearance.colors.colOnLayer2
// text: `Page ${root.responseData.page}`
text: StringUtils.format(Translation.tr("Page {0}"), root.responseData.page)
text: Translation.tr("Page %1").arg(root.responseData.page)
}
}
}