Quickshell qstr seems not to be working, trying to implement custom translation

Add Chinese (zh_CN) translations for Quickshell interface and settings
This commit is contained in:
月月
2025-06-17 12:29:21 +08:00
parent 54dfad1d5b
commit b32734b9f5
50 changed files with 1324 additions and 187 deletions
@@ -151,7 +151,7 @@ Rectangle {
color: Appearance.m3colors.m3onSecondaryContainer
text: messageData?.role == 'assistant' ? Ai.models[messageData?.model].name :
(messageData?.role == 'user' && SystemInfo.username) ? SystemInfo.username :
qsTr("Interface")
Translation.tr("Interface")
}
}
}
@@ -173,7 +173,7 @@ Rectangle {
text: "visibility_off"
}
StyledToolTip {
content: qsTr("Not visible to model")
content: Translation.tr("Not visible to model")
}
}
@@ -200,7 +200,7 @@ Rectangle {
}
StyledToolTip {
content: qsTr("Copy")
content: Translation.tr("Copy")
}
}
AiMessageControlButton {
@@ -215,7 +215,7 @@ Rectangle {
}
}
StyledToolTip {
content: root.editing ? qsTr("Save") : qsTr("Edit")
content: root.editing ? Translation.tr("Save") : Translation.tr("Edit")
}
}
AiMessageControlButton {
@@ -226,7 +226,7 @@ Rectangle {
root.renderMarkdown = !root.renderMarkdown
}
StyledToolTip {
content: qsTr("View Markdown source")
content: Translation.tr("View Markdown source")
}
}
AiMessageControlButton {
@@ -236,7 +236,7 @@ Rectangle {
Ai.removeMessage(root.messageIndex)
}
StyledToolTip {
content: qsTr("Delete")
content: Translation.tr("Delete")
}
}
}
@@ -87,7 +87,7 @@ ColumnLayout {
}
}
StyledToolTip {
content: qsTr("Copy code")
content: Translation.tr("Copy code")
}
}
AiMessageControlButton {
@@ -111,7 +111,7 @@ ColumnLayout {
}
}
StyledToolTip {
content: qsTr("Save to Downloads")
content: Translation.tr("Save to Downloads")
}
}
}
@@ -124,7 +124,7 @@ ColumnLayout {
wrapMode: TextEdit.Wrap
color: messageData.thinking ? Appearance.colors.colSubtext : Appearance.colors.colOnLayer1
textFormat: renderMarkdown ? TextEdit.MarkdownText : TextEdit.PlainText
text: qsTr("Waiting for response...")
text: Translation.tr("Waiting for response...")
onTextChanged: {
if (!root.editing) return
@@ -99,7 +99,7 @@ Item {
id: thinkBlockLanguage
Layout.fillWidth: false
Layout.alignment: Qt.AlignLeft
text: root.completed ? qsTr("Chain of Thought") : (qsTr("Thinking") + ".".repeat(Math.random() * 4))
text: root.completed ? Translation.tr("Chain of Thought") : (Translation.tr("Thinking") + ".".repeat(Math.random() * 4))
}
Item { Layout.fillWidth: true }
RippleButton { // Expand button