1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

Localization framework

This commit is contained in:
bbedward
2025-10-06 16:00:50 -04:00
parent 2ccec607a0
commit 5460c20ac3
79 changed files with 5356 additions and 396 deletions

View File

@@ -116,7 +116,7 @@ Item {
}
StyledText {
text: "No clipboard entries found"
text: qsTr("No clipboard entries found")
anchors.centerIn: parent
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceVariantText

View File

@@ -26,7 +26,7 @@ Rectangle {
}
StyledText {
text: "Shift+Del: Clear All • Esc: Close"
text: qsTr("Shift+Del: Clear All • Esc: Close")
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
anchors.horizontalCenter: parent.horizontalCenter

View File

@@ -188,7 +188,7 @@ PanelWindow {
}
StyledText {
text: "Select a color from the palette or use custom sliders"
text: qsTr("Select a color from the palette or use custom sliders")
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceTextMedium
}
@@ -346,7 +346,7 @@ PanelWindow {
spacing: Theme.spacingS
StyledText {
text: "Material Colors"
text: qsTr("Material Colors")
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceText
font.weight: Font.Medium
@@ -394,7 +394,7 @@ PanelWindow {
spacing: Theme.spacingXS
StyledText {
text: "Recent Colors"
text: qsTr("Recent Colors")
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceText
font.weight: Font.Medium
@@ -444,7 +444,7 @@ PanelWindow {
spacing: Theme.spacingXS
StyledText {
text: "Opacity"
text: qsTr("Opacity")
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceText
font.weight: Font.Medium
@@ -480,7 +480,7 @@ PanelWindow {
spacing: Theme.spacingS
StyledText {
text: "Hex:"
text: qsTr("Hex:")
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceTextMedium
anchors.verticalCenter: parent.verticalCenter
@@ -518,7 +518,7 @@ PanelWindow {
DankButton {
width: 80
buttonHeight: 36
text: "Apply"
text: qsTr("Apply")
backgroundColor: Theme.primary
textColor: Theme.background
anchors.verticalCenter: parent.verticalCenter
@@ -545,7 +545,7 @@ PanelWindow {
DankButton {
width: 70
buttonHeight: 36
text: "Cancel"
text: qsTr("Cancel")
backgroundColor: "transparent"
textColor: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
@@ -564,7 +564,7 @@ PanelWindow {
DankButton {
width: 70
buttonHeight: 36
text: "Copy"
text: qsTr("Copy")
backgroundColor: Theme.primary
textColor: Theme.background
anchors.verticalCenter: parent.verticalCenter

View File

@@ -755,7 +755,7 @@ DankModal {
width: parent.width - saveButton.width - Theme.spacingM
height: 40
text: defaultFileName
placeholderText: "Enter filename..."
placeholderText: qsTr("Enter filename...")
ignoreLeftRightKeys: false
focus: saveMode
topPadding: Theme.spacingS
@@ -788,7 +788,7 @@ DankModal {
StyledText {
anchors.centerIn: parent
text: "Save"
text: qsTr("Save")
color: fileNameInput.text.trim() !== "" ? Theme.primaryText : Theme.surfaceVariantText
font.pixelSize: Theme.fontSizeMedium
}

View File

@@ -134,7 +134,7 @@ Rectangle {
}
StyledText {
text: "File Information"
text: qsTr("File Information")
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceText
font.weight: Font.Medium

View File

@@ -56,7 +56,7 @@ DankModal {
spacing: Theme.spacingXS
StyledText {
text: "Network Information"
text: qsTr("Network Information")
font.pixelSize: Theme.fontSizeLarge
color: Theme.surfaceText
font.weight: Font.Medium
@@ -126,7 +126,7 @@ DankModal {
id: closeText
anchors.centerIn: parent
text: "Close"
text: qsTr("Close")
font.pixelSize: Theme.fontSizeMedium
color: Theme.background
font.weight: Font.Medium

View File

@@ -32,24 +32,24 @@ DankModal {
close();
const actions = {
"logout": {
"title": "Log Out",
"message": "Are you sure you want to log out?"
"title": qsTr("Log Out"),
"message": qsTr("Are you sure you want to log out?")
},
"suspend": {
"title": "Suspend",
"message": "Are you sure you want to suspend the system?"
"title": qsTr("Suspend"),
"message": qsTr("Are you sure you want to suspend the system?")
},
"hibernate": {
"title": "Hibernate",
"message": "Are you sure you want to hibernate the system?"
"title": qsTr("Hibernate"),
"message": qsTr("Are you sure you want to hibernate the system?")
},
"reboot": {
"title": "Reboot",
"message": "Are you sure you want to reboot the system?"
"title": qsTr("Reboot"),
"message": qsTr("Are you sure you want to reboot the system?")
},
"poweroff": {
"title": "Power Off",
"message": "Are you sure you want to power off the system?"
"title": qsTr("Power Off"),
"message": qsTr("Are you sure you want to power off the system?")
}
}
const selected = actions[action]
@@ -144,7 +144,7 @@ DankModal {
width: parent.width
StyledText {
text: "Power Options"
text: qsTr("Power Options")
font.pixelSize: Theme.fontSizeLarge
color: Theme.surfaceText
font.weight: Font.Medium
@@ -201,7 +201,7 @@ DankModal {
}
StyledText {
text: "Log Out"
text: qsTr("Log Out")
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceText
font.weight: Font.Medium
@@ -254,7 +254,7 @@ DankModal {
}
StyledText {
text: "Suspend"
text: qsTr("Suspend")
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceText
font.weight: Font.Medium
@@ -308,7 +308,7 @@ DankModal {
}
StyledText {
text: "Hibernate"
text: qsTr("Hibernate")
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceText
font.weight: Font.Medium
@@ -362,7 +362,7 @@ DankModal {
}
StyledText {
text: "Reboot"
text: qsTr("Reboot")
font.pixelSize: Theme.fontSizeMedium
color: rebootArea.containsMouse ? Theme.warning : Theme.surfaceText
font.weight: Font.Medium
@@ -416,7 +416,7 @@ DankModal {
}
StyledText {
text: "Power Off"
text: qsTr("Power Off")
font.pixelSize: Theme.fontSizeMedium
color: powerOffArea.containsMouse ? Theme.error : Theme.surfaceText
font.weight: Font.Medium

View File

@@ -123,7 +123,7 @@ DankModal {
}
StyledText {
text: "System Monitor Unavailable"
text: qsTr("System Monitor Unavailable")
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Bold
color: Theme.error
@@ -154,7 +154,7 @@ DankModal {
height: 40
StyledText {
text: "System Monitor"
text: qsTr("System Monitor")
font.pixelSize: Theme.fontSizeLarge + 4
font.weight: Font.Bold
color: Theme.surfaceText

View File

@@ -19,7 +19,7 @@ Item {
spacing: Theme.spacingXL
StyledText {
text: "Battery not detected - only AC power settings available"
text: qsTr("Battery not detected - only AC power settings available")
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceVariantText
visible: !BatteryService.batteryAvailable
@@ -51,7 +51,7 @@ Item {
}
StyledText {
text: "Idle Settings"
text: qsTr("Idle Settings")
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Medium
color: Theme.surfaceText
@@ -79,7 +79,7 @@ Item {
property var timeoutOptions: ["Never", "1 minute", "2 minutes", "3 minutes", "5 minutes", "10 minutes", "15 minutes", "20 minutes", "30 minutes", "1 hour", "1 hour 30 minutes", "2 hours", "3 hours"]
property var timeoutValues: [0, 60, 120, 180, 300, 600, 900, 1200, 1800, 3600, 5400, 7200, 10800]
text: "Automatically lock after"
text: qsTr("Automatically lock after")
options: timeoutOptions
Connections {
@@ -115,7 +115,7 @@ Item {
property var timeoutOptions: ["Never", "1 minute", "2 minutes", "3 minutes", "5 minutes", "10 minutes", "15 minutes", "20 minutes", "30 minutes", "1 hour", "1 hour 30 minutes", "2 hours", "3 hours"]
property var timeoutValues: [0, 60, 120, 180, 300, 600, 900, 1200, 1800, 3600, 5400, 7200, 10800]
text: "Turn off monitors after"
text: qsTr("Turn off monitors after")
options: timeoutOptions
Connections {
@@ -151,7 +151,7 @@ Item {
property var timeoutOptions: ["Never", "1 minute", "2 minutes", "3 minutes", "5 minutes", "10 minutes", "15 minutes", "20 minutes", "30 minutes", "1 hour", "1 hour 30 minutes", "2 hours", "3 hours"]
property var timeoutValues: [0, 60, 120, 180, 300, 600, 900, 1200, 1800, 3600, 5400, 7200, 10800]
text: "Suspend system after"
text: qsTr("Suspend system after")
options: timeoutOptions
Connections {
@@ -187,7 +187,7 @@ Item {
property var timeoutOptions: ["Never", "1 minute", "2 minutes", "3 minutes", "5 minutes", "10 minutes", "15 minutes", "20 minutes", "30 minutes", "1 hour", "1 hour 30 minutes", "2 hours", "3 hours"]
property var timeoutValues: [0, 60, 120, 180, 300, 600, 900, 1200, 1800, 3600, 5400, 7200, 10800]
text: "Hibernate system after"
text: qsTr("Hibernate system after")
options: timeoutOptions
visible: SessionService.hibernateSupported
@@ -221,14 +221,14 @@ Item {
DankToggle {
width: parent.width
text: "Lock before suspend"
text: qsTr("Lock before suspend")
description: "Automatically lock the screen when the system prepares to suspend"
checked: SessionData.lockBeforeSuspend
onToggled: checked => SessionData.setLockBeforeSuspend(checked)
}
StyledText {
text: "Idle monitoring not supported - requires newer Quickshell version"
text: qsTr("Idle monitoring not supported - requires newer Quickshell version")
font.pixelSize: Theme.fontSizeSmall
color: Theme.error
anchors.horizontalCenter: parent.horizontalCenter

View File

@@ -144,7 +144,7 @@ DankModal {
}
StyledText {
text: "Settings"
text: qsTr("Settings")
font.pixelSize: Theme.fontSizeXLarge
color: Theme.surfaceText
font.weight: Font.Medium

View File

@@ -244,7 +244,7 @@ Rectangle {
}
StyledText {
text: "Launch"
text: qsTr("Launch")
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
font.weight: Font.Normal

View File

@@ -78,7 +78,7 @@ DankModal {
spacing: Theme.spacingXS
StyledText {
text: "Connect to Wi-Fi"
text: qsTr("Connect to Wi-Fi")
font.pixelSize: Theme.fontSizeLarge
color: Theme.surfaceText
font.weight: Font.Medium
@@ -201,7 +201,7 @@ DankModal {
}
StyledText {
text: "Show password"
text: qsTr("Show password")
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
@@ -229,7 +229,7 @@ DankModal {
id: cancelText
anchors.centerIn: parent
text: "Cancel"
text: qsTr("Cancel")
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceText
font.weight: Font.Medium
@@ -260,7 +260,7 @@ DankModal {
id: connectText
anchors.centerIn: parent
text: "Connect"
text: qsTr("Connect")
font.pixelSize: Theme.fontSizeMedium
color: Theme.background
font.weight: Font.Medium