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
@@ -377,7 +377,7 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\)
Layout.fillWidth: true
padding: 10
color: activeFocus ? Appearance.m3colors.m3onSurface : Appearance.m3colors.m3onSurfaceVariant
placeholderText: StringUtils.format(Translation.tr('Message the model... "{0}" for commands'), root.commandPrefix)
placeholderText: Translation.tr('Message the model... "%1" for commands').arg(root.commandPrefix)
background: null
@@ -577,8 +577,9 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\)
id: toolTip
extraVisibleCondition: false
alternativeVisibleCondition: mouseArea.containsMouse // Show tooltip when hovered
content: StringUtils.format(Translation.tr("Current model: {0}\nSet it with {1}model MODEL"),
Ai.getModel().name, root.commandPrefix)
content: Translation.tr("Current model: %1\nSet it with %2model MODEL")
.arg(Ai.getModel().name)
.arg(root.commandPrefix)
}
MouseArea {