use qsTr (for translations later)

This commit is contained in:
end-4
2025-04-24 20:28:22 +02:00
parent 84f031573e
commit 8dd82baf26
19 changed files with 41 additions and 41 deletions
@@ -17,7 +17,7 @@ Rectangle {
color: Appearance.colors.colLayer1
property int currentTab: 0
property var tabButtonList: [{"icon": "notifications", "name": "Notifications"}, {"icon": "volume_up", "name": "Volume mixer"}]
property var tabButtonList: [{"icon": "notifications", "name": qsTr("Notifications")}, {"icon": "volume_up", "name": qsTr("Volume mixer")}]
Keys.onPressed: (event) => {
if (event.key === Qt.Key_PageDown || event.key === Qt.Key_PageUp) {
@@ -127,7 +127,7 @@ Scope {
command: ["qs", "ipc", "call", "session", "open"]
}
StyledToolTip {
content: "Session"
content: qsTr("Session")
}
}
}
@@ -48,7 +48,7 @@ Item {
CalendarHeaderButton {
clip: true
buttonText: `${monthShift != 0 ? "• " : ""}${viewingDate.toLocaleDateString(Qt.locale(), "MMMM yyyy")}`
tooltipText: (monthShift === 0) ? "" : "Jump to current month"
tooltipText: (monthShift === 0) ? "" : qsTr("Jump to current month")
onClicked: {
monthShift = 0;
}
@@ -120,7 +120,7 @@ Item {
font.pixelSize: Appearance.font.pixelSize.normal
color: Appearance.m3colors.m3outline
horizontalAlignment: Text.AlignHCenter
text: "No notifications"
text: qsTr("No notifications")
}
}
}
@@ -155,7 +155,7 @@ Item {
Layout.margins: 5
Layout.topMargin: 10
buttonIcon: "clear_all"
buttonText: "Clear"
buttonText: qsTr("Clear")
onClicked: () => {
Notifications.discardAllNotifications()
}
@@ -39,7 +39,7 @@ QuickToggleButton {
}
StyledToolTip {
content: `${(Bluetooth.bluetoothEnabled && Bluetooth.bluetoothDeviceName.length > 0) ?
Bluetooth.bluetoothDeviceName : "Bluetooth"} | Right-click to configure`
Bluetooth.bluetoothDeviceName : "Bluetooth"} | ${qsTr("Right-click to configure")}`
}
}
@@ -25,6 +25,6 @@ QuickToggleButton {
command: ['bash', '-c', `hyprctl reload`]
}
StyledToolTip {
content: "Game mode"
content: qsTr("Game mode")
}
}
@@ -15,6 +15,6 @@ QuickToggleButton {
command: ["bash", "-c", "${XDG_CONFIG_HOME:-$HOME/.config}/quickshell/scripts/wayland-idle-inhibitor.py"]
}
StyledToolTip {
content: "Keep system awake"
content: qsTr("Keep system awake")
}
}
@@ -37,6 +37,6 @@ QuickToggleButton {
}
}
StyledToolTip {
content: "Night Light"
content: qsTr("Night Light")
}
}
@@ -9,7 +9,7 @@ import Qt5Compat.GraphicalEffects
Item {
id: root
property int currentTab: 0
property var tabButtonList: [{"icon": "checklist", "name": "Unfinished"}, {"name": "Done", "icon": "check_circle"}]
property var tabButtonList: [{"icon": "checklist", "name": qsTr("Unfinished")}, {"name": qsTr("Done"), "icon": "check_circle"}]
property bool showAddDialog: false
property int dialogMargins: 20
property int fabSize: 48
@@ -126,7 +126,7 @@ Item {
TaskList {
listBottomPadding: root.fabSize + root.fabMargins * 2
emptyPlaceholderIcon: "check_circle"
emptyPlaceholderText: "Nothing here!"
emptyPlaceholderText: qsTr("Nothing here!")
taskList: Todo.list
.map(function(item, i) { return Object.assign({}, item, {originalIndex: i}); })
.filter(function(item) { return !item.done; })
@@ -134,7 +134,7 @@ Item {
TaskList {
listBottomPadding: root.fabSize + root.fabMargins * 2
emptyPlaceholderIcon: "checklist"
emptyPlaceholderText: "Finished tasks will go here"
emptyPlaceholderText: qsTr("Finished tasks will go here")
taskList: Todo.list
.map(function(item, i) { return Object.assign({}, item, {originalIndex: i}); })
.filter(function(item) { return item.done; })
@@ -263,7 +263,7 @@ Item {
Layout.alignment: Qt.AlignLeft
color: Appearance.m3colors.m3onSurface
font.pixelSize: Appearance.font.pixelSize.larger
text: "Add task"
text: qsTr("Add task")
}
TextField {
@@ -274,7 +274,7 @@ Item {
padding: 10
color: activeFocus ? Appearance.m3colors.m3onSurface : Appearance.m3colors.m3onSurfaceVariant
selectedTextColor: Appearance.m3colors.m3onSurface
placeholderText: "Task description"
placeholderText: qsTr("Task description")
placeholderTextColor: Appearance.m3colors.m3outline
focus: root.showAddDialog
onAccepted: dialog.addTask()
@@ -302,11 +302,11 @@ Item {
spacing: 5
DialogButton {
buttonText: "Cancel"
buttonText: qsTr("Cancel")
onClicked: root.showAddDialog = false
}
DialogButton {
buttonText: "Add"
buttonText: qsTr("Add")
enabled: todoInput.text.length > 0
onClicked: dialog.addTask()
}
@@ -50,14 +50,14 @@ Button {
Layout.fillWidth: true
elide: Text.ElideRight
font.pixelSize: Appearance.font.pixelSize.normal
text: input ? "Input" : "Output"
text: input ? qsTr("Input") : qsTr("Output")
color: Appearance.colors.colOnLayer2
}
StyledText {
Layout.fillWidth: true
elide: Text.ElideRight
font.pixelSize: Appearance.font.pixelSize.smaller
text: (input ? Pipewire.defaultAudioSource?.description : Pipewire.defaultAudioSink?.description) ?? "Unknown"
text: (input ? Pipewire.defaultAudioSource?.description : Pipewire.defaultAudioSink?.description) ?? qsTr("Unknown")
color: Appearance.m3colors.m3outline
}
}
@@ -106,7 +106,7 @@ Item {
font.pixelSize: Appearance.font.pixelSize.normal
color: Appearance.m3colors.m3outline
horizontalAlignment: Text.AlignHCenter
text: "No audio source"
text: qsTr("No audio source")
}
}
}
@@ -341,13 +341,13 @@ Item {
Layout.alignment: Qt.AlignRight
DialogButton {
buttonText: "Cancel"
buttonText: qsTr("Cancel")
onClicked: {
root.showDeviceSelector = false
}
}
DialogButton {
buttonText: "OK"
buttonText: qsTr("OK")
onClicked: {
root.showDeviceSelector = false
if (root.selectedDevice) {