Merge branch 'i18n'

This commit is contained in:
ItsLemmy
2025-09-24 13:52:29 -04:00
92 changed files with 5121 additions and 1094 deletions
+2 -2
View File
@@ -62,7 +62,7 @@ Singleton {
function onMutedChanged() {
root._muted = (sink?.audio.muted ?? true)
Logger.log("AudioService", "OnMuteChanged:", root._muted)
ToastService.showNotice("Audio Output", root._muted ? "Muted" : "Unmuted")
ToastService.showNotice(I18n.tr("settings.audio.devices.output-device.label"), root._muted ? I18n.tr("toast.audio.muted") : I18n.tr("toast.audio.unmuted"))
}
}
@@ -80,7 +80,7 @@ Singleton {
function onMutedChanged() {
root._inputMuted = (source?.audio.muted ?? true)
Logger.log("AudioService", "OnInputMuteChanged:", root._inputMuted)
ToastService.showNotice("Microphone", root._inputMuted ? "Muted" : "Unmuted")
ToastService.showNotice(I18n.tr("settings.audio.devices.input-device.label"), root._inputMuted ? I18n.tr("toast.audio.muted") : I18n.tr("toast.audio.unmuted"))
}
}
+2 -2
View File
@@ -66,9 +66,9 @@ Singleton {
}
lastAdapterState = adapter.enabled
if (adapter.enabled) {
ToastService.showNotice("Bluetooth", "Enabled")
ToastService.showNotice(I18n.tr("bluetooth.panel.title"), I18n.tr("toast.bluetooth.enabled"))
} else {
ToastService.showNotice("Bluetooth", "Disabled")
ToastService.showNotice(I18n.tr("bluetooth.panel.title"), I18n.tr("toast.bluetooth.disabled"))
}
}
}
+1 -1
View File
@@ -70,7 +70,7 @@ Singleton {
root.cliphistAvailable = false
// Show toast notification if feature is enabled but cliphist is missing
if (Settings.data.appLauncher.enableClipboardHistory) {
ToastService.showWarning("Clipboard history unavailable", "The 'cliphist' application is not installed. Please install it to use clipboard history features.", false, 6000)
ToastService.showWarning(I18n.tr("toast.clipboard.unavailable"), I18n.tr("toast.clipboard.unavailable-desc"), false, 6000)
}
}
}
+3 -3
View File
@@ -16,7 +16,7 @@ Singleton {
readonly property alias data: adapter // Used to access via GitHubService.data.xxx.yyy
// Public properties for easy access
property string latestVersion: "Unknown"
property string latestVersion: I18n.tr("system.unknown-version")
property var contributors: []
FileView {
@@ -43,7 +43,7 @@ Singleton {
JsonAdapter {
id: adapter
property string version: "Unknown"
property string version: I18n.tr("system.unknown-version")
property var contributors: []
property real timestamp: 0
}
@@ -97,7 +97,7 @@ Singleton {
// --------------------------------
function resetCache() {
data.version = "Unknown"
data.version = I18n.tr("system.unknown-version")
data.contributors = []
data.timestamp = 0
+2 -2
View File
@@ -114,7 +114,7 @@ Item {
target: "powerPanel"
function toggle() {
sessionMenuPanel.toggle()
ToastService.showWarning("IPC", "PowerPanel has been renamed to SessionMenu, this IPC call will be deprecated soon. Please use \"ipc call sessionMenu toggle\" instead.", 8000)
ToastService.showWarning("IPC", I18n.tr("toast.ipc.powerpanel-deprecated"), 8000)
}
}
IpcHandler {
@@ -130,7 +130,7 @@ Item {
function toggle() {
// Will attempt to open the panel next to the bar button if any.
controlCenterPanel.toggle(BarService.lookupWidget("ControlCenter"))
ToastService.showWarning("IPC", "SidePanel has been renamed to ControlCenter, this IPC call will be deprecated soon. Please use \"ipc call controlCenter toggle\" instead.", 8000)
ToastService.showWarning("IPC", I18n.tr("toast.ipc.sidepanel-deprecated"), 8000)
}
}
IpcHandler {
+3 -3
View File
@@ -10,7 +10,7 @@ Singleton {
id: root
property bool isInhibited: false
property string reason: "User requested"
property string reason: I18n.tr("system.user-requested")
property var activeInhibitors: []
// Different inhibitor strategies
@@ -163,13 +163,13 @@ Singleton {
if (activeInhibitors.includes("manual")) {
removeInhibitor("manual")
Settings.data.ui.idleInhibitorEnabled = false
ToastService.showNotice("Keep awake", "Disabled")
ToastService.showNotice(I18n.tr("tooltips.keep-awake"), I18n.tr("toast.keep-awake.disabled"))
Logger.log("IdleInhibitor", "Manual inhibition disabled and saved to settings")
return false
} else {
addInhibitor("manual", "Manually activated by user")
Settings.data.ui.idleInhibitorEnabled = true
ToastService.showNotice("Keep awake", "Enabled")
ToastService.showNotice(I18n.tr("tooltips.keep-awake"), I18n.tr("toast.keep-awake.enabled"))
Logger.log("IdleInhibitor", "Manual inhibition enabled and saved to settings")
return true
}
+1 -1
View File
@@ -9,7 +9,7 @@ import qs.Services
Singleton {
id: root
property string currentLayout: "Unknown"
property string currentLayout: I18n.tr("system.unknown-layout")
property int updateInterval: 1000 // Update every second
// Timer to periodically update the layout
+8 -4
View File
@@ -48,9 +48,9 @@ Singleton {
target: Settings.data.network
function onWifiEnabledChanged() {
if (Settings.data.network.wifiEnabled) {
ToastService.showNotice("Wi-Fi", "Enabled")
ToastService.showNotice(I18n.tr("wifi.panel.title"), I18n.tr("toast.wifi.enabled"))
} else {
ToastService.showNotice("Wi-Fi", "Disabled")
ToastService.showNotice(I18n.tr("wifi.panel.title"), I18n.tr("toast.wifi.disabled"))
}
}
}
@@ -492,7 +492,9 @@ Singleton {
root.connecting = false
root.connectingTo = ""
Logger.log("Network", `Connected to network: '${connectProcess.ssid}'`)
ToastService.showNotice("Wi-Fi", `Connected to '${connectProcess.ssid}'`)
ToastService.showNotice(I18n.tr("wifi.panel.title"), I18n.tr("toast.wifi.connected", {
"ssid": connectProcess.ssid
}))
// Still do a scan to get accurate signal and security info
delayedScanTimer.interval = 5000
@@ -533,7 +535,9 @@ Singleton {
stdout: StdioCollector {
onStreamFinished: {
Logger.log("Network", `Disconnected from network: '${disconnectProcess.ssid}'`)
ToastService.showNotice("Wi-Fi", `Disconnected from '${disconnectProcess.ssid}'`)
ToastService.showNotice(I18n.tr("wifi.panel.title"), I18n.tr("toast.wifi.disconnected", {
"ssid": disconnectProcess.ssid
}))
// Immediately update UI on successful disconnect
root.updateNetworkStatus(disconnectProcess.ssid, false)
+2 -2
View File
@@ -63,12 +63,12 @@ Singleton {
apply()
// Toast: night light toggled
const enabled = !!Settings.data.nightLight.enabled
ToastService.showNotice("Night light", enabled ? "Enabled" : "Disabled")
ToastService.showNotice(I18n.tr("settings.display.night-light.section.label"), enabled ? I18n.tr("toast.night-light.enabled") : I18n.tr("toast.night-light.disabled"))
}
function onForcedChanged() {
apply()
if (Settings.data.nightLight.enabled) {
ToastService.showNotice("Night Light", Settings.data.nightLight.forced ? "Forced activation" : "Normal mode")
ToastService.showNotice(I18n.tr("settings.display.night-light.section.label"), Settings.data.nightLight.forced ? I18n.tr("toast.night-light.forced") : I18n.tr("toast.night-light.normal"))
}
}
function onNightTempChanged() {
+1 -1
View File
@@ -399,7 +399,7 @@ Singleton {
target: Settings.data.notifications
function onDoNotDisturbChanged() {
const enabled = Settings.data.notifications.doNotDisturb
ToastService.showNotice(enabled ? "'Do not disturb' enabled" : "'Do not disturb' disabled", enabled ? "You'll find these notifications in your history." : "Showing all notifications.")
ToastService.showNotice(enabled ? I18n.tr("toast.do-not-disturb.enabled") : I18n.tr("toast.do-not-disturb.disabled"), enabled ? I18n.tr("toast.do-not-disturb.enabled-desc") : I18n.tr("toast.do-not-disturb.disabled-desc"))
}
}
}
+3 -1
View File
@@ -78,7 +78,9 @@ Singleton {
// Only show toast if we have a valid profile name (not "Unknown")
const profileName = root.getName()
if (profileName !== "Unknown") {
ToastService.showNotice("Power profile changed", `"${profileName}"`)
ToastService.showNotice(I18n.tr("toast.power-profile.changed"), I18n.tr("toast.power-profile.profile-name", {
"profile": profileName
}))
}
}
}
+7 -7
View File
@@ -82,7 +82,7 @@ Singleton {
return
}
ToastService.showNotice("Stopping recording…", outputPath, 2000)
ToastService.showNotice(I18n.tr("toast.recording.stopping"), outputPath, 2000)
Quickshell.execDetached(["sh", "-c", "pkill -SIGINT -f 'gpu-screen-recorder' || pkill -SIGINT -f 'com.dec05eba.gpu_screen_recorder'"])
@@ -110,9 +110,9 @@ Singleton {
if (exitCode !== 0) {
const err = String(stderr.text || "").trim()
if (err.length > 0)
ToastService.showError("Failed to start recording", err, 7000)
ToastService.showError(I18n.tr("toast.recording.failed-start"), err, 7000)
else
ToastService.showError("Failed to start recording", "gpu-screen-recorder exited unexpectedly.", 7000)
ToastService.showError(I18n.tr("toast.recording.failed-start"), I18n.tr("toast.recording.failed-gpu"), 7000)
}
} else if (isRecording) {
// Process ended normally while recording
@@ -120,13 +120,13 @@ Singleton {
monitorTimer.running = false
// Consider successful save if exitCode == 0
if (exitCode === 0) {
ToastService.showNotice("Recording saved", outputPath, 5000)
ToastService.showNotice(I18n.tr("toast.recording.saved"), outputPath, 5000)
} else {
const err2 = String(stderr.text || "").trim()
if (err2.length > 0)
ToastService.showError("Recording failed", err2, 7000)
ToastService.showError(I18n.tr("toast.recording.failed-start"), err2, 7000)
else
ToastService.showError("Recording failed", "The recorder exited with an error.", 7000)
ToastService.showError(I18n.tr("toast.recording.failed-start"), I18n.tr("toast.recording.failed-general"), 7000)
}
}
}
@@ -142,7 +142,7 @@ Singleton {
} else {
isPending = false
hasActiveRecording = false
ToastService.showError("Desktop portals not running", "Start xdg-desktop-portal and a compositor portal (wlr/hyprland/gnome/kde).", 8000)
ToastService.showError(I18n.tr("toast.recording.no-portals"), I18n.tr("toast.recording.no-portals-desc"), 8000)
}
}
}