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
@@ -1,5 +1,6 @@
import "root:/modules/common"
import "root:/modules/common/widgets"
import "root:/services/"
import QtQuick
import QtQuick.Layouts
import Quickshell.Wayland
@@ -26,7 +27,7 @@ Item {
font.pixelSize: Appearance.font.pixelSize.smaller
color: Appearance.colors.colSubtext
elide: Text.ElideRight
text: root.activeWindow?.activated ? root.activeWindow?.appId : qsTr("Desktop")
text: root.activeWindow?.activated ? root.activeWindow?.appId : Translation.tr("Desktop")
}
StyledText {
@@ -34,7 +35,7 @@ Item {
font.pixelSize: Appearance.font.pixelSize.small
color: Appearance.colors.colOnLayer0
elide: Text.ElideRight
text: root.activeWindow?.activated ? root.activeWindow?.title : `${qsTr("Workspace")} ${monitor.activeWorkspace?.id}`
text: root.activeWindow?.activated ? root.activeWindow?.title : `${Translation.tr("Workspace")} ${monitor.activeWorkspace?.id}`
}
}