forked from Shinonome/dots-hyprland
mfking chore: add qsTr() to strings for translations
This commit is contained in:
@@ -108,7 +108,7 @@ Scope {
|
||||
ScrollHint {
|
||||
reveal: barLeftSideMouseArea.hovered
|
||||
icon: "light_mode"
|
||||
tooltipText: "Scroll to change brightness"
|
||||
tooltipText: qsTr("Scroll to change brightness")
|
||||
side: "left"
|
||||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
@@ -283,7 +283,7 @@ Scope {
|
||||
ScrollHint {
|
||||
reveal: barRightSideMouseArea.hovered
|
||||
icon: "volume_up"
|
||||
tooltipText: "Scroll to change volume"
|
||||
tooltipText: qsTr("Scroll to change volume")
|
||||
side: "right"
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
@@ -12,7 +12,7 @@ import Quickshell.Hyprland
|
||||
Item {
|
||||
id: root
|
||||
readonly property MprisPlayer activePlayer: MprisController.activePlayer
|
||||
readonly property string cleanedTitle: StringUtils.cleanMusicTitle(activePlayer?.trackTitle) || "No media"
|
||||
readonly property string cleanedTitle: StringUtils.cleanMusicTitle(activePlayer?.trackTitle) || qsTr("No media")
|
||||
|
||||
Layout.fillHeight: true
|
||||
implicitWidth: rowLayout.implicitWidth + rowLayout.spacing * 2
|
||||
|
||||
@@ -156,7 +156,7 @@ Scope { // Scope
|
||||
|
||||
GlobalShortcut {
|
||||
name: "cheatsheetToggle"
|
||||
description: "Toggles cheatsheet on press"
|
||||
description: qsTr("Toggles cheatsheet on press")
|
||||
|
||||
onPressed: {
|
||||
cheatsheetLoader.active = !cheatsheetLoader.active;
|
||||
@@ -165,7 +165,7 @@ Scope { // Scope
|
||||
|
||||
GlobalShortcut {
|
||||
name: "cheatsheetOpen"
|
||||
description: "Opens cheatsheet on press"
|
||||
description: qsTr("Opens cheatsheet on press")
|
||||
|
||||
onPressed: {
|
||||
cheatsheetLoader.active = true;
|
||||
@@ -174,7 +174,7 @@ Scope { // Scope
|
||||
|
||||
GlobalShortcut {
|
||||
name: "cheatsheetClose"
|
||||
description: "Closes cheatsheet on press"
|
||||
description: qsTr("Closes cheatsheet on press")
|
||||
|
||||
onPressed: {
|
||||
cheatsheetLoader.active = false;
|
||||
|
||||
@@ -5,7 +5,7 @@ pragma ComponentBehavior: Bound
|
||||
|
||||
Singleton {
|
||||
property QtObject ai: QtObject {
|
||||
property string systemPrompt: "Use casual tone. No user knowledge is to be assumed except basic Linux literacy. Be brief and concise: When explaining concepts, use bullet points (prefer minus sign (-) over asterisk (*)) and highlight keywords in bold to pinpoint the main concepts instead of long paragraphs. You are also encouraged to split your response with h2 headers, each header title beginning with an emoji, like `## 🐧 Linux`."
|
||||
property string systemPrompt: qsTr("Use casual tone. No user knowledge is to be assumed except basic Linux literacy. Be brief and concise: When explaining concepts, use bullet points (prefer minus sign (-) over asterisk (*)) and highlight keywords in bold to pinpoint the main concepts instead of long paragraphs. You are also encouraged to split your response with h2 headers, each header title beginning with an emoji, like `## 🐧 Linux`.")
|
||||
}
|
||||
|
||||
property QtObject appearance: QtObject {
|
||||
@@ -70,7 +70,7 @@ Singleton {
|
||||
property string defaultProvider: "yandere"
|
||||
property int limit: 20
|
||||
property QtObject zerochan: QtObject {
|
||||
property string username: ""
|
||||
property string username: "[unset]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ Item {
|
||||
onPressAndHold: (mouse) => {
|
||||
if (mouse.button === Qt.LeftButton) {
|
||||
Hyprland.dispatch(`exec wl-copy '${StringUtils.shellSingleQuoteEscape(notificationObject.body)}'`)
|
||||
notificationSummaryText.text = `${notificationObject.summary} (copied)`
|
||||
notificationSummaryText.text = String.format(qsTr("{0} (copied)"), notificationObject.summary)
|
||||
}
|
||||
}
|
||||
onDragStartedChanged: () => {
|
||||
|
||||
@@ -115,7 +115,7 @@ Scope {
|
||||
|
||||
GlobalShortcut {
|
||||
name: "mediaControlsToggle"
|
||||
description: "Toggles media controls on press"
|
||||
description: qsTr("Toggles media controls on press")
|
||||
|
||||
onPressed: {
|
||||
if (!mediaControlsLoader.active && Mpris.players.values.filter(player => isRealPlayer(player)).length === 0) {
|
||||
@@ -127,7 +127,7 @@ Scope {
|
||||
}
|
||||
GlobalShortcut {
|
||||
name: "mediaControlsOpen"
|
||||
description: "Opens media controls on press"
|
||||
description: qsTr("Opens media controls on press")
|
||||
|
||||
onPressed: {
|
||||
mediaControlsLoader.active = true;
|
||||
@@ -136,7 +136,7 @@ Scope {
|
||||
}
|
||||
GlobalShortcut {
|
||||
name: "mediaControlsClose"
|
||||
description: "Closes media controls on press"
|
||||
description: qsTr("Closes media controls on press")
|
||||
|
||||
onPressed: {
|
||||
mediaControlsLoader.active = false;
|
||||
|
||||
@@ -131,7 +131,7 @@ Scope {
|
||||
|
||||
GlobalShortcut {
|
||||
name: "osdBrightnessTrigger"
|
||||
description: "Triggers brightness OSD on press"
|
||||
description: qsTr("Triggers brightness OSD on press")
|
||||
|
||||
onPressed: {
|
||||
root.triggerOsd()
|
||||
@@ -139,7 +139,7 @@ Scope {
|
||||
}
|
||||
GlobalShortcut {
|
||||
name: "osdBrightnessHide"
|
||||
description: "Hides brightness OSD on press"
|
||||
description: qsTr("Hides brightness OSD on press")
|
||||
|
||||
onPressed: {
|
||||
root.showOsdValues = false
|
||||
|
||||
@@ -129,7 +129,7 @@ Scope {
|
||||
}
|
||||
GlobalShortcut {
|
||||
name: "osdVolumeTrigger"
|
||||
description: "Triggers volume OSD on press"
|
||||
description: qsTr("Triggers volume OSD on press")
|
||||
|
||||
onPressed: {
|
||||
root.triggerOsd()
|
||||
@@ -137,7 +137,7 @@ Scope {
|
||||
}
|
||||
GlobalShortcut {
|
||||
name: "osdVolumeHide"
|
||||
description: "Hides volume OSD on press"
|
||||
description: qsTr("Hides volume OSD on press")
|
||||
|
||||
onPressed: {
|
||||
root.showOsdValues = false
|
||||
|
||||
@@ -128,7 +128,7 @@ Scope {
|
||||
|
||||
GlobalShortcut {
|
||||
name: "overviewToggle"
|
||||
description: "Toggles overview on press"
|
||||
description: qsTr("Toggles overview on press")
|
||||
|
||||
onPressed: {
|
||||
GlobalStates.overviewOpen = !GlobalStates.overviewOpen
|
||||
@@ -136,7 +136,7 @@ Scope {
|
||||
}
|
||||
GlobalShortcut {
|
||||
name: "overviewClose"
|
||||
description: "Closes overview"
|
||||
description: qsTr("Closes overview")
|
||||
|
||||
onPressed: {
|
||||
GlobalStates.overviewOpen = false
|
||||
@@ -144,7 +144,7 @@ Scope {
|
||||
}
|
||||
GlobalShortcut {
|
||||
name: "overviewToggleRelease"
|
||||
description: "Toggles overview on release"
|
||||
description: qsTr("Toggles overview on release")
|
||||
|
||||
onPressed: {
|
||||
GlobalStates.superReleaseMightTrigger = true
|
||||
@@ -160,9 +160,9 @@ Scope {
|
||||
}
|
||||
GlobalShortcut {
|
||||
name: "overviewToggleReleaseInterrupt"
|
||||
description: "Interrupts possibility of overview being toggled on release. " +
|
||||
"This is necessary because GlobalShortcut.onReleased in quickshell triggers whether or not you press something else while holding the key. " +
|
||||
"To make sure this works consistently, use binditn = MODKEYS, catchall in an automatically triggered submap that includes everything."
|
||||
description: qsTr("Interrupts possibility of overview being toggled on release. ") +
|
||||
qsTr("This is necessary because GlobalShortcut.onReleased in quickshell triggers whether or not you press something else while holding the key. ") +
|
||||
qsTr("To make sure this works consistently, use binditn = MODKEYS, catchall in an automatically triggered submap that includes everything.")
|
||||
|
||||
onPressed: {
|
||||
GlobalStates.superReleaseMightTrigger = false
|
||||
|
||||
@@ -103,7 +103,7 @@ Button {
|
||||
StyledText {
|
||||
font.pixelSize: Appearance.font.pixelSize.small
|
||||
color: Appearance.colors.colSubtext
|
||||
visible: root.itemType && root.itemType != "App"
|
||||
visible: root.itemType && root.itemType != qsTr("App")
|
||||
text: root.itemType
|
||||
}
|
||||
StyledText {
|
||||
|
||||
@@ -276,7 +276,7 @@ Item { // Wrapper
|
||||
nonAppResultsTimer.restart();
|
||||
const mathResultObject = {
|
||||
name: root.mathResult,
|
||||
clickActionName: "Copy",
|
||||
clickActionName: qsTr("Copy"),
|
||||
type: qsTr("Math result"),
|
||||
fontType: "monospace",
|
||||
materialSymbol: 'calculate',
|
||||
@@ -286,7 +286,7 @@ Item { // Wrapper
|
||||
}
|
||||
const commandResultObject = {
|
||||
name: searchingText,
|
||||
clickActionName: "Run",
|
||||
clickActionName: qsTr("Run"),
|
||||
type: qsTr("Run command"),
|
||||
fontType: "monospace",
|
||||
materialSymbol: 'terminal',
|
||||
@@ -300,8 +300,8 @@ Item { // Wrapper
|
||||
if (actionString.startsWith(root.searchingText) || root.searchingText.startsWith(actionString)) {
|
||||
return {
|
||||
name: root.searchingText.startsWith(actionString) ? root.searchingText : actionString,
|
||||
clickActionName: "Run",
|
||||
type: "Action",
|
||||
clickActionName: qsTr("Run"),
|
||||
type: qsTr("Action"),
|
||||
materialSymbol: 'settings_suggest',
|
||||
execute: () => {
|
||||
action.execute(root.searchingText.split(" ").slice(1).join(" "))
|
||||
@@ -319,8 +319,8 @@ Item { // Wrapper
|
||||
result = result.concat(
|
||||
AppSearch.fuzzyQuery(root.searchingText)
|
||||
.map((entry) => {
|
||||
entry.clickActionName = "Launch";
|
||||
entry.type = "App"
|
||||
entry.clickActionName = qsTr("Launch");
|
||||
entry.type = qsTr("App");
|
||||
return entry;
|
||||
})
|
||||
);
|
||||
@@ -344,8 +344,8 @@ Item { // Wrapper
|
||||
// Web search
|
||||
result.push({
|
||||
name: root.searchingText,
|
||||
clickActionName: "Search",
|
||||
type: "Search the web",
|
||||
clickActionName: qsTr("Search"),
|
||||
type: qsTr("Search the web"),
|
||||
materialSymbol: 'travel_explore',
|
||||
execute: () => {
|
||||
let url = ConfigOptions.search.engineBaseUrl + root.searchingText
|
||||
@@ -361,8 +361,6 @@ Item { // Wrapper
|
||||
}
|
||||
delegate: SearchItem {
|
||||
entry: modelData
|
||||
// itemName: modelData.name
|
||||
// itemIcon: modelData.icon
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ Scope {
|
||||
|
||||
GlobalShortcut {
|
||||
name: "sessionToggle"
|
||||
description: "Toggles session screen on press"
|
||||
description: qsTr("Toggles session screen on press")
|
||||
|
||||
onPressed: {
|
||||
sessionLoader.active = !sessionLoader.active;
|
||||
@@ -218,7 +218,7 @@ Scope {
|
||||
|
||||
GlobalShortcut {
|
||||
name: "sessionOpen"
|
||||
description: "Opens session screen on press"
|
||||
description: qsTr("Opens session screen on press")
|
||||
|
||||
onPressed: {
|
||||
sessionLoader.active = true;
|
||||
|
||||
@@ -192,7 +192,7 @@ Scope { // Scope
|
||||
|
||||
GlobalShortcut {
|
||||
name: "sidebarLeftToggle"
|
||||
description: "Toggles left sidebar on press"
|
||||
description: qsTr("Toggles left sidebar on press")
|
||||
|
||||
onPressed: {
|
||||
sidebarLoader.active = !sidebarLoader.active;
|
||||
@@ -202,7 +202,7 @@ Scope { // Scope
|
||||
|
||||
GlobalShortcut {
|
||||
name: "sidebarLeftOpen"
|
||||
description: "Opens left sidebar on press"
|
||||
description: qsTr("Opens left sidebar on press")
|
||||
|
||||
onPressed: {
|
||||
sidebarLoader.active = true;
|
||||
@@ -212,7 +212,7 @@ Scope { // Scope
|
||||
|
||||
GlobalShortcut {
|
||||
name: "sidebarLeftClose"
|
||||
description: "Closes left sidebar on press"
|
||||
description: qsTr("Closes left sidebar on press")
|
||||
|
||||
onPressed: {
|
||||
sidebarLoader.active = false;
|
||||
|
||||
@@ -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 :
|
||||
(messageData.role == 'interface') ? qsTr("Interface") : qsTr("Unknown")
|
||||
qsTr("Interface")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ Item {
|
||||
id: thinkBlockLanguage
|
||||
Layout.fillWidth: false
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
text: root.completed ? "Chain of Thought" : ("Thinking" + ".".repeat(Math.random() * 4))
|
||||
text: root.completed ? qsTr("Chain of Thought") : (qsTr("Thinking") + ".".repeat(Math.random() * 4))
|
||||
}
|
||||
Item { Layout.fillWidth: true }
|
||||
Button { // Expand button
|
||||
|
||||
@@ -94,7 +94,7 @@ Button {
|
||||
PointingHandInteraction {}
|
||||
|
||||
StyledToolTip {
|
||||
content: `${StringUtils.wordWrap(root.imageData.tags, root.maxTagStringLineLength)}\nClick for options`
|
||||
content: `${StringUtils.wordWrap(root.imageData.tags, root.maxTagStringLineLength)}\n${qsTr("Click for options")}`
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
@@ -177,7 +177,7 @@ Button {
|
||||
MenuButton {
|
||||
id: downloadButton
|
||||
Layout.fillWidth: true
|
||||
buttonText: "Download"
|
||||
buttonText: qsTr("Download")
|
||||
onClicked: {
|
||||
root.showActions = false
|
||||
Hyprland.dispatch(`exec curl '${root.imageData.file_url}' -o '${root.imageData.is_nsfw ? root.nsfwPath : root.downloadPath}/${root.fileName}' && notify-send '${qsTr("Download complete")}' '${root.downloadPath}/${root.fileName}'`)
|
||||
|
||||
@@ -2,6 +2,7 @@ import "root:/"
|
||||
import "root:/services"
|
||||
import "root:/modules/common"
|
||||
import "root:/modules/common/widgets"
|
||||
import "root:/modules/common/functions/string_utils.js" as StringUtils
|
||||
import "../"
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
@@ -93,7 +94,8 @@ Rectangle {
|
||||
anchors.centerIn: parent
|
||||
font.pixelSize: Appearance.font.pixelSize.smaller
|
||||
color: Appearance.colors.colOnLayer2
|
||||
text: `Page ${root.responseData.page}`
|
||||
// text: `Page ${root.responseData.page}`
|
||||
text: StringUtils.format(qsTr("Page {0}"), root.responseData.page)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import "root:/"
|
||||
import "root:/services"
|
||||
import "root:/modules/common"
|
||||
import "root:/modules/common/widgets"
|
||||
import "root:/modules/common/functions/string_utils.js" as StringUtils
|
||||
import "./quickToggles/"
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
@@ -102,7 +103,7 @@ Scope {
|
||||
StyledText {
|
||||
font.pixelSize: Appearance.font.pixelSize.normal
|
||||
color: Appearance.colors.colOnLayer0
|
||||
text: `Uptime: ${DateTime.uptime}`
|
||||
text: StringUtils.format(qsTr("Uptime: {0}"), DateTime.uptime)
|
||||
textFormat: Text.MarkdownText
|
||||
}
|
||||
|
||||
@@ -197,7 +198,7 @@ Scope {
|
||||
|
||||
GlobalShortcut {
|
||||
name: "sidebarRightToggle"
|
||||
description: "Toggles right sidebar on press"
|
||||
description: qsTr("Toggles right sidebar on press")
|
||||
|
||||
onPressed: {
|
||||
sidebarLoader.active = !sidebarLoader.active;
|
||||
@@ -206,7 +207,7 @@ Scope {
|
||||
}
|
||||
GlobalShortcut {
|
||||
name: "sidebarRightOpen"
|
||||
description: "Opens right sidebar on press"
|
||||
description: qsTr("Opens right sidebar on press")
|
||||
|
||||
onPressed: {
|
||||
sidebarLoader.active = true;
|
||||
@@ -215,7 +216,7 @@ Scope {
|
||||
}
|
||||
GlobalShortcut {
|
||||
name: "sidebarRightClose"
|
||||
description: "Closes right sidebar on press"
|
||||
description: qsTr("Closes right sidebar on press")
|
||||
|
||||
onPressed: {
|
||||
sidebarLoader.active = false;
|
||||
|
||||
@@ -2,6 +2,7 @@ import "../"
|
||||
import "root:/services"
|
||||
import "root:/modules/common"
|
||||
import "root:/modules/common/widgets"
|
||||
import "root:/modules/common/functions/string_utils.js" as StringUtils
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
@@ -37,8 +38,9 @@ QuickToggleButton {
|
||||
}
|
||||
}
|
||||
StyledToolTip {
|
||||
content: `${(Bluetooth.bluetoothEnabled && Bluetooth.bluetoothDeviceName.length > 0) ?
|
||||
Bluetooth.bluetoothDeviceName : "Bluetooth"} | ${qsTr("Right-click to configure")}`
|
||||
content: StringUtils.format(qsTr("{0} | Right-click to configure"),
|
||||
(Bluetooth.bluetoothEnabled && Bluetooth.bluetoothDeviceName.length > 0) ?
|
||||
Bluetooth.bluetoothDeviceName : qsTr("Bluetooth"))
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import "root:/services"
|
||||
import "root:/modules/common"
|
||||
import "root:/modules/common/widgets"
|
||||
import "root:/services"
|
||||
import "root:/modules/common/functions/string_utils.js" as StringUtils
|
||||
import "../"
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
@@ -42,6 +43,6 @@ QuickToggleButton {
|
||||
}
|
||||
}
|
||||
StyledToolTip {
|
||||
content: `${Network.networkName} | Right-click to configure`
|
||||
content: StringUtils.format(qsTr("{0} | Right-click to configure"), Network.networkName)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user