From e6da762870b8fe95f702616fe43d1f3b63646abe Mon Sep 17 00:00:00 2001 From: Youseffo13 <110458691+Youseffo13@users.noreply.github.com> Date: Wed, 13 May 2026 15:23:50 +0200 Subject: [PATCH] Added Missing i18n Strings (#2398) * Update hypr-colors.conf * added i18n strings * added missing i18n strings * Update TypographyMotionTab.qml --- quickshell/Common/Theme.qml | 20 ++++---- quickshell/Modals/Common/ConfirmModal.qml | 12 ++--- quickshell/Modals/DankColorPickerModal.qml | 6 +-- .../Modals/DankLauncherV2/Controller.qml | 2 +- quickshell/Modals/WifiQRCodeModal.qml | 4 +- .../ControlCenter/Details/BatteryDetail.qml | 4 +- .../Modules/DankBar/Widgets/Battery.qml | 4 +- .../Modules/Notepad/NotepadSettings.qml | 10 ++-- .../Modules/Settings/PluginListItem.qml | 20 ++++---- quickshell/Modules/Settings/PluginsTab.qml | 2 +- .../Modules/Settings/TypographyMotionTab.qml | 50 +++++++++++-------- quickshell/Services/DMSNetworkService.qml | 2 +- quickshell/Services/DMSService.qml | 2 +- quickshell/Services/DisplayService.qml | 2 +- quickshell/Services/NiriService.qml | 4 +- quickshell/Services/SessionService.qml | 2 +- quickshell/matugen/templates/hypr-colors.conf | 2 +- 17 files changed, 79 insertions(+), 69 deletions(-) diff --git a/quickshell/Common/Theme.qml b/quickshell/Common/Theme.qml index 05d806df..44d4788a 100644 --- a/quickshell/Common/Theme.qml +++ b/quickshell/Common/Theme.qml @@ -1859,7 +1859,7 @@ Singleton { function applyGtkColors() { if (!matugenAvailable) { if (typeof ToastService !== "undefined") { - ToastService.showError("matugen not available or disabled - cannot apply GTK colors"); + ToastService.showError(I18n.tr("matugen not available or disabled - cannot apply GTK colors")); } return; } @@ -1868,11 +1868,11 @@ Singleton { Proc.runCommand("gtkApplier", [shellDir + "/scripts/gtk.sh", configDir, isLight, shellDir], (output, exitCode) => { if (exitCode === 0) { if (typeof ToastService !== "undefined" && typeof NiriService !== "undefined" && !NiriService.matugenSuppression) { - ToastService.showInfo("GTK colors applied successfully"); + ToastService.showInfo(I18n.tr("GTK colors applied successfully")); } } else { if (typeof ToastService !== "undefined") { - ToastService.showError("Failed to apply GTK colors"); + ToastService.showError(I18n.tr("Failed to apply GTK colors")); } } }); @@ -1881,7 +1881,7 @@ Singleton { function applyQtColors() { if (!matugenAvailable) { if (typeof ToastService !== "undefined") { - ToastService.showError("matugen not available or disabled - cannot apply Qt colors"); + ToastService.showError(I18n.tr("matugen not available or disabled - cannot apply Qt colors")); } return; } @@ -1889,11 +1889,11 @@ Singleton { Proc.runCommand("qtApplier", [shellDir + "/scripts/qt.sh", configDir], (output, exitCode) => { if (exitCode === 0) { if (typeof ToastService !== "undefined") { - ToastService.showInfo("Qt colors applied successfully"); + ToastService.showInfo(I18n.tr("Qt colors applied successfully")); } } else { if (typeof ToastService !== "undefined") { - ToastService.showError("Failed to apply Qt colors"); + ToastService.showError(I18n.tr("Failed to apply Qt colors")); } } }); @@ -2034,7 +2034,7 @@ Singleton { break; default: if (typeof ToastService !== "undefined") { - ToastService.showError("Theme worker failed (" + exitCode + ")"); + ToastService.showError(I18n.tr("Theme worker failed (%1)").arg(exitCode)); } log.warn("Matugen worker failed with exit code:", exitCode); root.matugenCompleted(currentMode, "error"); @@ -2060,7 +2060,7 @@ Singleton { var themeData = JSON.parse(customThemeFileView.text()); loadCustomTheme(themeData); } catch (e) { - ToastService.showError("Invalid JSON format: " + e.message); + ToastService.showError(I18n.tr("Invalid JSON format: %1").arg(e.message)); } } @@ -2074,7 +2074,7 @@ Singleton { onLoadFailed: function (error) { if (typeof ToastService !== "undefined") { - ToastService.showError("Failed to read theme file: " + error); + ToastService.showError(I18n.tr("Failed to read theme file: %1").arg(error)); } } } @@ -2102,7 +2102,7 @@ Singleton { log.error("Failed to parse dynamic colors:", e); if (typeof ToastService !== "undefined") { ToastService.wallpaperErrorStatus = "error"; - ToastService.showError("Dynamic colors parse error: " + e.message); + ToastService.showError(I18n.tr("Dynamic colors parse error: %1").arg(e.message)); } } } diff --git a/quickshell/Modals/Common/ConfirmModal.qml b/quickshell/Modals/Common/ConfirmModal.qml index b9c9b908..fc307536 100644 --- a/quickshell/Modals/Common/ConfirmModal.qml +++ b/quickshell/Modals/Common/ConfirmModal.qml @@ -11,8 +11,8 @@ DankModal { property string confirmTitle: "" property string confirmMessage: "" - property string confirmButtonText: "Confirm" - property string cancelButtonText: "Cancel" + property string confirmButtonText: I18n.tr("Confirm") + property string cancelButtonText: I18n.tr("Cancel") property color confirmButtonColor: Theme.primary property var onConfirm: function () {} property var onCancel: function () {} @@ -22,8 +22,8 @@ DankModal { function show(title, message, onConfirmCallback, onCancelCallback) { confirmTitle = title || ""; confirmMessage = message || ""; - confirmButtonText = "Confirm"; - cancelButtonText = "Cancel"; + confirmButtonText = I18n.tr("Confirm"); + cancelButtonText = I18n.tr("Cancel"); confirmButtonColor = Theme.primary; onConfirm = onConfirmCallback || (() => {}); onCancel = onCancelCallback || (() => {}); @@ -35,8 +35,8 @@ DankModal { function showWithOptions(options) { confirmTitle = options.title || ""; confirmMessage = options.message || ""; - confirmButtonText = options.confirmText || "Confirm"; - cancelButtonText = options.cancelText || "Cancel"; + confirmButtonText = options.confirmText || I18n.tr("Confirm"); + cancelButtonText = options.cancelText || I18n.tr("Cancel"); confirmButtonColor = options.confirmColor || Theme.primary; onConfirm = options.onConfirm || (() => {}); onCancel = options.onCancel || (() => {}); diff --git a/quickshell/Modals/DankColorPickerModal.qml b/quickshell/Modals/DankColorPickerModal.qml index dacc8351..f868db62 100644 --- a/quickshell/Modals/DankColorPickerModal.qml +++ b/quickshell/Modals/DankColorPickerModal.qml @@ -73,7 +73,7 @@ DankModal { function copyColorToClipboard(colorValue) { Quickshell.execDetached(["dms", "cl", "copy", colorValue]); - ToastService.showInfo(`Color ${colorValue} copied`); + ToastService.showInfo(I18n.tr("Color %1 copied").arg(colorValue)); SessionData.addRecentColor(currentColor); } @@ -679,7 +679,7 @@ DankModal { rgbString = `rgb(${r}, ${g}, ${b})`; } Quickshell.execDetached(["dms", "cl", "copy", rgbString]); - ToastService.showInfo(`${rgbString} copied`); + ToastService.showInfo(I18n.tr("%1 copied").arg(rgbString)); } } } @@ -744,7 +744,7 @@ DankModal { hsvString = `${h}, ${s}, ${v}`; } Quickshell.execDetached(["dms", "cl", "copy", hsvString]); - ToastService.showInfo(`HSV ${hsvString} copied`); + ToastService.showInfo(I18n.tr("HSV %1 copied").arg(hsvString)); } } } diff --git a/quickshell/Modals/DankLauncherV2/Controller.qml b/quickshell/Modals/DankLauncherV2/Controller.qml index 57e58695..cbf57a8b 100644 --- a/quickshell/Modals/DankLauncherV2/Controller.qml +++ b/quickshell/Modals/DankLauncherV2/Controller.qml @@ -125,7 +125,7 @@ Item { if (!selectedItem) return; if (!SessionService.wtypeAvailable) { - ToastService.showError("wtype not available - install wtype for paste support"); + ToastService.showError(I18n.tr("wtype not available - install wtype for paste support")); return; } diff --git a/quickshell/Modals/WifiQRCodeModal.qml b/quickshell/Modals/WifiQRCodeModal.qml index 06ffab7c..7962c249 100644 --- a/quickshell/Modals/WifiQRCodeModal.qml +++ b/quickshell/Modals/WifiQRCodeModal.qml @@ -52,7 +52,7 @@ DankModal { ssid: ssid }, response => { if (response.error) { - ToastService.showError("Failed to fetch network QR code: ", JSON.stringify(response.error)); + ToastService.showError(I18n.tr("Failed to fetch network QR code: %1").arg(JSON.stringify(response.error))); } else if (response.result) { themedQrCodePath = response.result[0]; normalQrCodePath = response.result[1]; @@ -66,7 +66,7 @@ DankModal { path: path }, response => { if (response.error) { - ToastService.showError(`Failed to remove QR code at ${path}: `, JSON.stringify(response.error)); + ToastService.showError(I18n.tr("Failed to remove QR code at %1: %2").arg(path).arg(JSON.stringify(response.error))); } }) } diff --git a/quickshell/Modules/ControlCenter/Details/BatteryDetail.qml b/quickshell/Modules/ControlCenter/Details/BatteryDetail.qml index a6cfe521..bccd33c4 100644 --- a/quickshell/Modules/ControlCenter/Details/BatteryDetail.qml +++ b/quickshell/Modules/ControlCenter/Details/BatteryDetail.qml @@ -25,12 +25,12 @@ Rectangle { function setProfile(profile) { if (typeof PowerProfiles === "undefined") { - ToastService.showError("power-profiles-daemon not available"); + ToastService.showError(I18n.tr("power-profiles-daemon not available")); return; } PowerProfiles.profile = profile; if (PowerProfiles.profile !== profile) { - ToastService.showError("Failed to set power profile"); + ToastService.showError(I18n.tr("Failed to set power profile")); } } diff --git a/quickshell/Modules/DankBar/Widgets/Battery.qml b/quickshell/Modules/DankBar/Widgets/Battery.qml index 9f3fa468..51968709 100644 --- a/quickshell/Modules/DankBar/Widgets/Battery.qml +++ b/quickshell/Modules/DankBar/Widgets/Battery.qml @@ -141,7 +141,7 @@ BasePill { // This is after the other delta checks so it only shows on valid Y scroll if (typeof PowerProfiles === "undefined") { - ToastService.showError("power-profiles-daemon not available"); + ToastService.showError(I18n.tr("power-profiles-daemon not available")); return; } @@ -162,7 +162,7 @@ BasePill { // Set new profile PowerProfiles.profile = profiles[index]; if (PowerProfiles.profile !== profiles[index]) { - ToastService.showError("Failed to set power profile"); + ToastService.showError(I18n.tr("Failed to set power profile")); } } } diff --git a/quickshell/Modules/Notepad/NotepadSettings.qml b/quickshell/Modules/Notepad/NotepadSettings.qml index 9265ddf8..a701df62 100644 --- a/quickshell/Modules/Notepad/NotepadSettings.qml +++ b/quickshell/Modules/Notepad/NotepadSettings.qml @@ -128,7 +128,7 @@ Item { anchors.leftMargin: -Theme.spacingM width: parent.width + Theme.spacingM text: I18n.tr("Use Monospace Font") - description: "Toggle fonts" + description: I18n.tr("Toggle fonts") checked: SettingsData.notepadUseMonospace onToggled: checked => { SettingsData.notepadUseMonospace = checked; @@ -140,7 +140,7 @@ Item { anchors.leftMargin: -Theme.spacingM width: parent.width + Theme.spacingM text: I18n.tr("Show Line Numbers") - description: "Display line numbers in editor" + description: I18n.tr("Display line numbers in editor") checked: SettingsData.notepadShowLineNumbers onToggled: checked => { SettingsData.notepadShowLineNumbers = checked; @@ -212,7 +212,7 @@ Item { options: cachedFontFamilies currentValue: { if (!SettingsData.notepadFontFamily || SettingsData.notepadFontFamily === "") - return "Default (Global)"; + return I18n.tr("Default (Global)"); else return SettingsData.notepadFontFamily; } @@ -322,7 +322,7 @@ Item { anchors.leftMargin: -Theme.spacingM width: parent.width + Theme.spacingM text: I18n.tr("Custom Transparency") - description: "Override global transparency for Notepad" + description: I18n.tr("Override global transparency for Notepad") checked: SettingsData.notepadTransparencyOverride >= 0 onToggled: checked => { if (checked) { @@ -356,7 +356,7 @@ Item { StyledText { width: parent.width - text: SettingsData.notepadUseMonospace ? "Using global monospace font from Settings → Personalization" : "Global fonts can be configured in Settings → Personalization" + text: SettingsData.notepadUseMonospace ? I18n.tr("Using global monospace font from Settings → Personalization") : I18n.tr("Global fonts can be configured in Settings → Personalization") font.pixelSize: Theme.fontSizeSmall color: Theme.surfaceTextMedium wrapMode: Text.WordWrap diff --git a/quickshell/Modules/Settings/PluginListItem.qml b/quickshell/Modules/Settings/PluginListItem.qml index 02083942..6509e987 100644 --- a/quickshell/Modules/Settings/PluginListItem.qml +++ b/quickshell/Modules/Settings/PluginListItem.qml @@ -203,10 +203,10 @@ StyledRect { const currentPluginId = root.pluginId; DMSService.update(currentPluginName, response => { if (response.error) { - ToastService.showError("Update failed: " + response.error); + ToastService.showError(I18n.tr("Update failed: %1").arg(response.error)); return; } - ToastService.showInfo("Plugin updated: " + currentPluginName); + ToastService.showInfo(I18n.tr("Plugin updated: %1").arg(currentPluginName)); PluginService.forceRescanPlugin(currentPluginId); if (DMSService.apiVersion >= 8) DMSService.listInstalled(); @@ -246,10 +246,10 @@ StyledRect { const currentPluginName = root.pluginName; DMSService.uninstall(currentPluginName, response => { if (response.error) { - ToastService.showError("Uninstall failed: " + response.error); + ToastService.showError(I18n.tr("Uninstall failed: %1").arg(response.error)); return; } - ToastService.showInfo("Plugin uninstalled: " + currentPluginName); + ToastService.showInfo(I18n.tr("Plugin uninstalled: %1").arg(currentPluginName)); PluginService.scanPlugins(); if (root.isExpanded) root.expandedPluginId = ""; @@ -290,10 +290,10 @@ StyledRect { const currentPluginName = root.pluginName; root.isReloading = true; if (PluginService.reloadPlugin(currentPluginId)) { - ToastService.showInfo("Plugin reloaded: " + currentPluginName); + ToastService.showInfo(I18n.tr("Plugin reloaded: %1").arg(currentPluginName)); return; } - ToastService.showError("Failed to reload plugin: " + currentPluginName); + ToastService.showError(I18n.tr("Failed to reload plugin: %1").arg(currentPluginName)); root.isReloading = false; } onEntered: { @@ -317,19 +317,19 @@ StyledRect { if (isChecked) { if (PluginService.enablePlugin(currentPluginId)) { - ToastService.showInfo("Plugin enabled: " + currentPluginName); + ToastService.showInfo(I18n.tr("Plugin enabled: %1").arg(currentPluginName)); return; } - ToastService.showError("Failed to enable plugin: " + currentPluginName); + ToastService.showError(I18n.tr("Failed to enable plugin: %1").arg(currentPluginName)); return; } if (PluginService.disablePlugin(currentPluginId)) { - ToastService.showInfo("Plugin disabled: " + currentPluginName); + ToastService.showInfo(I18n.tr("Plugin disabled: %1").arg(currentPluginName)); if (root.isExpanded) root.expandedPluginId = ""; return; } - ToastService.showError("Failed to disable plugin: " + currentPluginName); + ToastService.showError(I18n.tr("Failed to disable plugin: %1").arg(currentPluginName)); } } } diff --git a/quickshell/Modules/Settings/PluginsTab.qml b/quickshell/Modules/Settings/PluginsTab.qml index 0fccb660..6eb272f9 100644 --- a/quickshell/Modules/Settings/PluginsTab.qml +++ b/quickshell/Modules/Settings/PluginsTab.qml @@ -257,7 +257,7 @@ FocusScope { PluginService.openPluginDirectory(); } else { PluginService.createPluginDirectory(); - ToastService.showInfo("Created plugin directory: " + PluginService.pluginDirectory); + ToastService.showInfo(I18n.tr("Created plugin directory: %1").arg(PluginService.pluginDirectory)); } } } diff --git a/quickshell/Modules/Settings/TypographyMotionTab.qml b/quickshell/Modules/Settings/TypographyMotionTab.qml index 8d7c9a11..8cc4f62d 100644 --- a/quickshell/Modules/Settings/TypographyMotionTab.qml +++ b/quickshell/Modules/Settings/TypographyMotionTab.qml @@ -251,59 +251,69 @@ Item { settingKey: "fontWeight" text: I18n.tr("Font Weight") description: I18n.tr("Select font weight for UI text") - options: ["Thin", "Extra Light", "Light", "Regular", "Medium", "Demi Bold", "Bold", "Extra Bold", "Black"] + options: [ + I18n.tr("Thin"), + I18n.tr("Extra Light"), + I18n.tr("Light"), + I18n.tr("Regular"), + I18n.tr("Medium"), + I18n.tr("Demi Bold"), + I18n.tr("Bold"), + I18n.tr("Extra Bold"), + I18n.tr("Black") + ] currentValue: { switch (SettingsData.fontWeight) { case Font.Thin: - return "Thin"; + return I18n.tr("Thin"); case Font.ExtraLight: - return "Extra Light"; + return I18n.tr("Extra Light"); case Font.Light: - return "Light"; + return I18n.tr("Light"); case Font.Normal: - return "Regular"; + return I18n.tr("Regular"); case Font.Medium: - return "Medium"; + return I18n.tr("Medium"); case Font.DemiBold: - return "Demi Bold"; + return I18n.tr("Demi Bold"); case Font.Bold: - return "Bold"; + return I18n.tr("Bold"); case Font.ExtraBold: - return "Extra Bold"; + return I18n.tr("Extra Bold"); case Font.Black: - return "Black"; + return I18n.tr("Black"); default: - return "Regular"; + return I18n.tr("Regular"); } } onValueChanged: value => { var weight; switch (value) { - case "Thin": + case I18n.tr("Thin"): weight = Font.Thin; break; - case "Extra Light": + case I18n.tr("Extra Light"): weight = Font.ExtraLight; break; - case "Light": + case I18n.tr("Light"): weight = Font.Light; break; - case "Regular": + case I18n.tr("Regular"): weight = Font.Normal; break; - case "Medium": + case I18n.tr("Medium"): weight = Font.Medium; break; - case "Demi Bold": + case I18n.tr("Demi Bold"): weight = Font.DemiBold; break; - case "Bold": + case I18n.tr("Bold"): weight = Font.Bold; break; - case "Extra Bold": + case I18n.tr("Extra Bold"): weight = Font.ExtraBold; break; - case "Black": + case I18n.tr("Black"): weight = Font.Black; break; default: diff --git a/quickshell/Services/DMSNetworkService.qml b/quickshell/Services/DMSNetworkService.qml index 6795bb6a..a4c1782c 100644 --- a/quickshell/Services/DMSNetworkService.qml +++ b/quickshell/Services/DMSNetworkService.qml @@ -373,7 +373,7 @@ Singleton { if (wifiConnected && currentWifiSSID === pendingConnectionSSID && wifiIP) { const elapsed = Date.now() - pendingConnectionStartTime; log.info("Successfully connected to", pendingConnectionSSID, "in", elapsed, "ms"); - ToastService.showInfo(`Connected to ${pendingConnectionSSID}`); + ToastService.showInfo(I18n.tr("Connected to %1").arg(pendingConnectionSSID)); if (userPreference === "wifi" || userPreference === "auto") { setConnectionPriority("wifi"); diff --git a/quickshell/Services/DMSService.qml b/quickshell/Services/DMSService.qml index f56d5e49..c0305316 100644 --- a/quickshell/Services/DMSService.qml +++ b/quickshell/Services/DMSService.qml @@ -342,7 +342,7 @@ Singleton { log.info("Connected (API v" + apiVersion + ", CLI " + cliVersion + ") -", JSON.stringify(capabilities)); if (apiVersion < expectedApiVersion) { - ToastService.showError("DMS server is outdated (API v" + apiVersion + ", expected v" + expectedApiVersion + ")"); + ToastService.showError(I18n.tr("DMS server is outdated (API v%1, expected v%2)").arg(apiVersion).arg(expectedApiVersion)); } capabilitiesReceived(); diff --git a/quickshell/Services/DisplayService.qml b/quickshell/Services/DisplayService.qml index 9c462e51..7f9794c8 100644 --- a/quickshell/Services/DisplayService.qml +++ b/quickshell/Services/DisplayService.qml @@ -444,7 +444,7 @@ Singleton { // Night Mode Functions - Simplified function enableNightMode() { if (!gammaControlAvailable) { - ToastService.showWarning("Night mode failed: DMS gamma control not available"); + ToastService.showWarning(I18n.tr("Night mode failed: DMS gamma control not available")); return; } diff --git a/quickshell/Services/NiriService.qml b/quickshell/Services/NiriService.qml index da0f5668..b82064c5 100644 --- a/quickshell/Services/NiriService.qml +++ b/quickshell/Services/NiriService.qml @@ -108,7 +108,7 @@ Singleton { if (exitCode === 0) { configValidationOutput = ""; } else if (hasInitialConnection && configValidationOutput.length > 0) { - ToastService.showError("niri: failed to load config", configValidationOutput, "", "niri-config"); + ToastService.showError(I18n.tr("niri: failed to load config"), configValidationOutput, "", "niri-config"); } } } @@ -568,7 +568,7 @@ Singleton { configReloaded(); if (hasInitialConnection && !suppressConfigToast && !suppressNextConfigToast && !matugenSuppression) { - ToastService.showInfo("niri: config reloaded", "", "", "niri-config"); + ToastService.showInfo(I18n.tr("niri: config reloaded"), "", "", "niri-config"); } else if (suppressNextConfigToast) { suppressNextConfigToast = false; suppressResetTimer.stop(); diff --git a/quickshell/Services/SessionService.qml b/quickshell/Services/SessionService.qml index 88dbe627..c96d83bb 100644 --- a/quickshell/Services/SessionService.qml +++ b/quickshell/Services/SessionService.qml @@ -116,7 +116,7 @@ Singleton { errorOutput = ""; return; } - ToastService.showError("Hibernate failed", errorOutput); + ToastService.showError(I18n.tr("Hibernate failed"), errorOutput); errorOutput = ""; } } diff --git a/quickshell/matugen/templates/hypr-colors.conf b/quickshell/matugen/templates/hypr-colors.conf index 8f7a2fa6..730bbd88 100644 --- a/quickshell/matugen/templates/hypr-colors.conf +++ b/quickshell/matugen/templates/hypr-colors.conf @@ -1,4 +1,4 @@ -# ! Auto-generated file. Do not edit directly. +# Auto-generated by DMS - do not edit manually # Remove source = ./dms/colors.conf from your config to override. $primary = rgb({{colors.primary.default.hex_stripped}})