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
@@ -28,9 +28,9 @@ QuickToggleButton {
}
}
StyledToolTip {
content: StringUtils.format(qsTr("{0} | Right-click to configure"),
content: StringUtils.format(Translation.tr("{0} | Right-click to configure"),
(Bluetooth.bluetoothEnabled && Bluetooth.bluetoothDeviceName.length > 0) ?
Bluetooth.bluetoothDeviceName : qsTr("Bluetooth"))
Bluetooth.bluetoothDeviceName : Translation.tr("Bluetooth"))
}
}
@@ -1,6 +1,7 @@
import "root:/modules/common"
import "root:/modules/common/widgets"
import "../"
import "root:/services/"
import Quickshell
import Quickshell.Io
import Quickshell.Hyprland
@@ -21,6 +22,6 @@ QuickToggleButton {
}
StyledToolTip {
content: qsTr("Game mode")
content: Translation.tr("Game mode")
}
}
@@ -1,6 +1,7 @@
import "root:/modules/common"
import "root:/modules/common/widgets"
import "../"
import "root:/services/"
import Quickshell.Io
import Quickshell
import Quickshell.Hyprland
@@ -27,6 +28,6 @@ QuickToggleButton {
}
}
StyledToolTip {
content: qsTr("Keep system awake")
content: Translation.tr("Keep system awake")
}
}
@@ -3,6 +3,7 @@ import "root:/modules/common"
import "root:/modules/common/widgets"
import "root:/modules/common/functions/string_utils.js" as StringUtils
import "../"
import "root:/services/"
import QtQuick
import Quickshell
import Quickshell.Io
@@ -28,6 +29,6 @@ QuickToggleButton {
}
}
StyledToolTip {
content: StringUtils.format(qsTr("{0} | Right-click to configure"), Network.networkName)
content: StringUtils.format(Translation.tr("{0} | Right-click to configure"), Network.networkName)
}
}
@@ -1,6 +1,7 @@
import "root:/modules/common"
import "root:/modules/common/widgets"
import "../"
import "root:/services/"
import Quickshell.Io
import Quickshell
@@ -37,6 +38,6 @@ QuickToggleButton {
}
}
StyledToolTip {
content: qsTr("Night Light")
content: Translation.tr("Night Light")
}
}