i18n:Replace qstr with Translation.tr and update the translation file

This commit is contained in:
月月
2025-07-12 22:46:24 +08:00
parent af5d25b575
commit fb0d3f7f40
8 changed files with 196 additions and 20 deletions
@@ -73,7 +73,7 @@ Item {
},
{
name: "save",
description: qsTr("Save chat"),
description: Translation.tr("Save chat"),
execute: (args) => {
const joinedArgs = args.join(" ")
if (joinedArgs.trim().length == 0) {
@@ -85,7 +85,7 @@ Item {
},
{
name: "load",
description: qsTr("Load chat"),
description: Translation.tr("Load chat"),
execute: (args) => {
const joinedArgs = args.join(" ")
if (joinedArgs.trim().length == 0) {
@@ -97,7 +97,7 @@ Item {
},
{
name: "clear",
description: qsTr("Clear chat history"),
description: Translation.tr("Clear chat history"),
execute: () => {
Ai.clearMessages();
}
@@ -47,7 +47,7 @@ Item { // Tag suggestion description
}
StyledText {
visible: root.showArrows && root.showTab
text: qsTr("or")
text: Translation.tr("or")
font.pixelSize: Appearance.font.pixelSize.smaller
}
KeyboardKey {
@@ -19,9 +19,9 @@ Item {
required property var scopeRoot
anchors.fill: parent
property var tabButtonList: [
...(Config.options.policies.ai !== 0 ? [{"icon": "neurology", "name": qsTr("Intelligence")}] : []),
{"icon": "translate", "name": qsTr("Translator")},
...(Config.options.policies.weeb === 1 ? [{"icon": "bookmark_heart", "name": qsTr("Anime")}] : [])
...(Config.options.policies.ai !== 0 ? [{"icon": "neurology", "name": Translation.tr("Intelligence")}] : []),
{"icon": "translate", "name": Translation.tr("Translator")},
...(Config.options.policies.weeb === 1 ? [{"icon": "bookmark_heart", "name": Translation.tr("Anime")}] : [])
]
property int selectedTab: 0
@@ -17,8 +17,8 @@ Rectangle {
property int selectedTab: 0
property bool collapsed: Persistent.states.sidebar.bottomGroup.collapsed
property var tabs: [
{"type": "calendar", "name": "Calendar", "icon": "calendar_month", "widget": calendarWidget},
{"type": "todo", "name": "To Do", "icon": "done_outline", "widget": todoWidget}
{"type": "calendar", "name": Translation.tr("Calendar"), "icon": "calendar_month", "widget": calendarWidget},
{"type": "todo", "name": Translation.tr("To Do"), "icon": "done_outline", "widget": todoWidget}
]
Behavior on implicitHeight {
@@ -85,7 +85,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 10
horizontalAlignment: Text.AlignHCenter
text: `${Notifications.list.length} notifications`
text: `${Notifications.list.length} ${Translation.tr("notifications")}`
opacity: Notifications.list.length > 0 ? 1 : 0
visible: opacity > 0