From 075c8f08f6eeccf4b8ea602ac6a7cc4a5e407870 Mon Sep 17 00:00:00 2001 From: lysec Date: Thu, 9 Oct 2025 17:56:49 +0200 Subject: [PATCH] quicksettings: replace hardcoded text with i18n, edit label & tooltip, force hover when recording --- Assets/Translations/de.json | 118 ++++++++++++- Assets/Translations/en.json | 75 ++++++++ Assets/Translations/es.json | 118 ++++++++++++- Assets/Translations/fr.json | 162 +++++++++++++++++- Assets/Translations/pt.json | 118 ++++++++++++- Assets/Translations/zh-CN.json | 118 ++++++++++++- Assets/settings-default.json | 2 +- Commons/I18n.qml | 18 +- Commons/Settings.qml | 2 +- Modules/ControlCenter/Widgets/Bluetooth.qml | 4 +- Modules/ControlCenter/Widgets/KeepAwake.qml | 4 +- Modules/ControlCenter/Widgets/NightLight.qml | 12 +- .../{DoNotDisturb.qml => Notifications.qml} | 7 +- .../ControlCenter/Widgets/PowerProfile.qml | 4 +- .../ControlCenter/Widgets/ScreenRecorder.qml | 8 +- .../Widgets/WallpaperSelector.qml | 4 +- Modules/ControlCenter/Widgets/WiFi.qml | 25 ++- Modules/Settings/Tabs/ControlCenterTab.qml | 2 +- Services/ControlCenterWidgetRegistry.qml | 6 +- 19 files changed, 754 insertions(+), 53 deletions(-) rename Modules/ControlCenter/Widgets/{DoNotDisturb.qml => Notifications.qml} (51%) diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index eb2f15ce..6f530c47 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -744,8 +744,52 @@ "description": "Konfigurieren und verwalten Sie Kontrollzentrum-Widgets und deren Anzeigeoptionen." } } + }, + "quickSettings": { + "notifications": { + "label": "Benachrichtigungen", + "tooltip": { + "enable": "Nicht stören aktivieren", + "disable": "Nicht stören deaktivieren" + } }, - "hooks": { + "wifi": { + "label": { + "wifi": "Wi-Fi", + "ethernet": "Netzwerk" + }, + "tooltip": { + "wifi": { + "connected": "Wi-Fi verbunden", + "disconnected": "Wi-Fi getrennt" + }, + "ethernet": { + "connected": "Ethernet verbunden" + } + } + }, + "bluetooth": { + "label": "Bluetooth", + "tooltip": { + "enabled": "Bluetooth aktiviert", + "disabled": "Bluetooth deaktiviert" + } + }, + "screenRecorder": { + "label": "Bildschirm", + "tooltip": { + "start": "Bildschirmaufnahme starten", + "stop": "Aufnahme beenden" + } + }, + "powerProfile": { + "tooltip": { + "current": "Aktuell: {profile}", + "unavailable": "Energieprofile nicht verfügbar" + } + } + }, + "hooks": { "title": "Hooks", "system-hooks": { "section": { @@ -1432,6 +1476,78 @@ "restart": "Neu starten", "suspend": "Ruhezustand" }, + "quickSettings": { + "notifications": { + "label": { + "enabled": "Benachrichtigungen", + "disabled": "Nicht stören" + }, + "tooltip": { + "action": "Linksklick: Benachrichtigungsverlauf öffnen\nRechtsklick: Nicht stören umschalten" + } + }, + "screenRecorder": { + "label": { + "recording": "Stopp", + "stopped": "Aufnehmen" + }, + "tooltip": { + "action": "Klicken zum Starten/Stoppen der Bildschirmaufnahme" + } + }, + "powerProfile": { + "label": { + "unavailable": "Energieprofil" + }, + "tooltip": { + "action": "Klicken zum Wechseln des Energieprofils" + } + }, + "wifi": { + "label": { + "ethernet": "Ethernet", + "wifi": "Wi-Fi", + "disconnected": "Wi-Fi getrennt" + }, + "tooltip": { + "action": "Klicken zum Verwalten der Wi-Fi-Verbindungen" + } + }, + "bluetooth": { + "label": { + "enabled": "Bluetooth", + "disabled": "Bluetooth" + }, + "tooltip": { + "action": "Klicken zum Verwalten der Bluetooth-Geräte" + } + }, + "nightLight": { + "label": { + "enabled": "Nachtlicht", + "forced": "Nachtlicht", + "disabled": "Nachtlicht" + }, + "tooltip": { + "action": "Klicken zum Wechseln des Nachtlicht-Modus\nRechtsklick: Einstellungen öffnen" + } + }, + "wallpaperSelector": { + "label": "Hintergrundbild", + "tooltip": { + "action": "Linksklick: Hintergrundbildauswahl öffnen\nRechtsklick: Zufälliges Hintergrundbild setzen" + } + }, + "keepAwake": { + "label": { + "enabled": "Wach halten", + "disabled": "Wach halten" + }, + "tooltip": { + "action": "Klicken zum Umschalten des Wach-halten-Modus" + } + } + }, "toast": { "night-light": { "enabled": "Aktiviert", diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 4d7e9b13..b9dd76b7 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -741,6 +741,9 @@ "label": "Widgets", "description": "Configure and manage Control Center widgets and their display options." } + }, + "quickSettings": { + "sectionName": "Quick Settings" } }, "hooks": { @@ -1403,6 +1406,78 @@ "restart": "Restart", "suspend": "Suspend" }, + "quickSettings": { + "notifications": { + "label": { + "enabled": "Notifications", + "disabled": "Do Not Disturb" + }, + "tooltip": { + "action": "Left click: Open notification history\nRight click: Toggle Do Not Disturb" + } + }, + "screenRecorder": { + "label": { + "recording": "Stop", + "stopped": "Record" + }, + "tooltip": { + "action": "Click to start/stop screen recording" + } + }, + "powerProfile": { + "label": { + "unavailable": "Power Profile" + }, + "tooltip": { + "action": "Click to cycle power profile" + } + }, + "wifi": { + "label": { + "ethernet": "Ethernet", + "wifi": "Wi-Fi", + "disconnected": "Wi-Fi Disconnected" + }, + "tooltip": { + "action": "Click to manage Wi-Fi connections" + } + }, + "bluetooth": { + "label": { + "enabled": "Bluetooth", + "disabled": "Bluetooth" + }, + "tooltip": { + "action": "Click to manage Bluetooth devices" + } + }, + "nightLight": { + "label": { + "enabled": "Night Light", + "forced": "Night Light", + "disabled": "Night Light" + }, + "tooltip": { + "action": "Click to cycle Night Light mode\nRight click: Open settings" + } + }, + "wallpaperSelector": { + "label": "Wallpaper", + "tooltip": { + "action": "Left click: Open wallpaper selector\nRight click: Set random wallpaper" + } + }, + "keepAwake": { + "label": { + "enabled": "Keep Awake", + "disabled": "Keep Awake" + }, + "tooltip": { + "action": "Click to toggle keep awake mode" + } + } + }, "toast": { "night-light": { "enabled": "Enabled", diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index 5b904ade..c7e094ca 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -740,8 +740,52 @@ "description": "Configura y gestiona los widgets del centro de control y sus opciones de visualización." } } + }, + "quickSettings": { + "notifications": { + "label": "Notificaciones", + "tooltip": { + "enable": "Activar No molestar", + "disable": "Desactivar No molestar" + } }, - "hooks": { + "wifi": { + "label": { + "wifi": "Wi-Fi", + "ethernet": "Red" + }, + "tooltip": { + "wifi": { + "connected": "Wi-Fi conectado", + "disconnected": "Wi-Fi desconectado" + }, + "ethernet": { + "connected": "Ethernet conectado" + } + } + }, + "bluetooth": { + "label": "Bluetooth", + "tooltip": { + "enabled": "Bluetooth habilitado", + "disabled": "Bluetooth deshabilitado" + } + }, + "screenRecorder": { + "label": "Pantalla", + "tooltip": { + "start": "Iniciar grabación de pantalla", + "stop": "Detener grabación" + } + }, + "powerProfile": { + "tooltip": { + "current": "Actual: {profile}", + "unavailable": "Perfiles de energía no disponibles" + } + } + }, + "hooks": { "title": "Hooks", "system-hooks": { "section": { @@ -1400,6 +1444,78 @@ "restart": "Reiniciar", "suspend": "Suspender" }, + "quickSettings": { + "notifications": { + "label": { + "enabled": "Notificaciones", + "disabled": "No molestar" + }, + "tooltip": { + "action": "Clic izquierdo: Abrir historial de notificaciones\nClic derecho: Alternar No molestar" + } + }, + "screenRecorder": { + "label": { + "recording": "Detener", + "stopped": "Grabar" + }, + "tooltip": { + "action": "Hacer clic para iniciar/detener la grabación de pantalla" + } + }, + "powerProfile": { + "label": { + "unavailable": "Perfil de energía" + }, + "tooltip": { + "action": "Hacer clic para cambiar el perfil de energía" + } + }, + "wifi": { + "label": { + "ethernet": "Ethernet", + "wifi": "Wi-Fi", + "disconnected": "Wi-Fi desconectado" + }, + "tooltip": { + "action": "Hacer clic para gestionar las conexiones Wi-Fi" + } + }, + "bluetooth": { + "label": { + "enabled": "Bluetooth", + "disabled": "Bluetooth" + }, + "tooltip": { + "action": "Hacer clic para gestionar los dispositivos Bluetooth" + } + }, + "nightLight": { + "label": { + "enabled": "Luz nocturna", + "forced": "Luz nocturna", + "disabled": "Luz nocturna" + }, + "tooltip": { + "action": "Hacer clic para alternar el modo Luz nocturna\nClic derecho: Abrir configuración" + } + }, + "wallpaperSelector": { + "label": "Fondo de pantalla", + "tooltip": { + "action": "Clic izquierdo: Abrir selector de fondo de pantalla\nClic derecho: Establecer fondo de pantalla aleatorio" + } + }, + "keepAwake": { + "label": { + "enabled": "Mantener despierto", + "disabled": "Mantener despierto" + }, + "tooltip": { + "action": "Hacer clic para alternar el modo Mantener despierto" + } + } + }, "toast": { "night-light": { "enabled": "Activada", diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index aab3dd41..1a659cb7 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -741,7 +741,95 @@ } } }, - "hooks": { + "quickSettings": { + "notifications": { + "label": "Notifications", + "tooltip": { + "enable": "Activer Ne pas déranger", + "disable": "Désactiver Ne pas déranger" + } + }, + "wifi": { + "label": { + "wifi": "Wi-Fi", + "ethernet": "Réseau" + }, + "tooltip": { + "wifi": { + "connected": "Wi-Fi connecté", + "disconnected": "Wi-Fi déconnecté" + }, + "ethernet": { + "connected": "Ethernet connecté" + } + } + }, + "bluetooth": { + "label": "Bluetooth", + "tooltip": { + "enabled": "Bluetooth activé", + "disabled": "Bluetooth désactivé" + } + }, + "screenRecorder": { + "label": "Écran", + "tooltip": { + "start": "Démarrer l'enregistrement d'écran", + "stop": "Arrêter l'enregistrement" + } + }, + "powerProfile": { + "tooltip": { + "current": "Actuel : {profile}", + "unavailable": "Profils d'alimentation non disponibles" + } + } + }, + "quickSettings": { + "notifications": { + "label": "Notifications", + "tooltip": { + "enable": "Activer Ne pas déranger", + "disable": "Désactiver Ne pas déranger" + } + }, + "wifi": { + "label": { + "wifi": "Wi-Fi", + "ethernet": "Réseau" + }, + "tooltip": { + "wifi": { + "connected": "Wi-Fi connecté", + "disconnected": "Wi-Fi déconnecté" + }, + "ethernet": { + "connected": "Ethernet connecté" + } + } + }, + "bluetooth": { + "label": "Bluetooth", + "tooltip": { + "enabled": "Bluetooth activé", + "disabled": "Bluetooth désactivé" + } + }, + "screenRecorder": { + "label": "Écran", + "tooltip": { + "start": "Démarrer l'enregistrement d'écran", + "stop": "Arrêter l'enregistrement" + } + }, + "powerProfile": { + "tooltip": { + "current": "Actuel : {profile}", + "unavailable": "Profils d'alimentation non disponibles" + } + } + }, + "hooks": { "title": "Hooks", "system-hooks": { "section": { @@ -1400,6 +1488,78 @@ "restart": "Redémarrer", "suspend": "Mettre en veille" }, + "quickSettings": { + "notifications": { + "label": { + "enabled": "Notifications", + "disabled": "Ne pas déranger" + }, + "tooltip": { + "action": "Clic gauche : Ouvrir l'historique des notifications\nClic droit : Basculer Ne pas déranger" + } + }, + "screenRecorder": { + "label": { + "recording": "Arrêter", + "stopped": "Enregistrer" + }, + "tooltip": { + "action": "Cliquer pour démarrer/arrêter l'enregistrement d'écran" + } + }, + "powerProfile": { + "label": { + "unavailable": "Profil d'alimentation" + }, + "tooltip": { + "action": "Cliquer pour changer de profil d'alimentation" + } + }, + "wifi": { + "label": { + "ethernet": "Ethernet", + "wifi": "Wi-Fi", + "disconnected": "Wi-Fi déconnecté" + }, + "tooltip": { + "action": "Cliquer pour gérer les connexions Wi-Fi" + } + }, + "bluetooth": { + "label": { + "enabled": "Bluetooth", + "disabled": "Bluetooth" + }, + "tooltip": { + "action": "Cliquer pour gérer les appareils Bluetooth" + } + }, + "nightLight": { + "label": { + "enabled": "Lumière nocturne", + "forced": "Lumière nocturne", + "disabled": "Lumière nocturne" + }, + "tooltip": { + "action": "Cliquer pour basculer le mode Lumière nocturne\nClic droit : Ouvrir les paramètres" + } + }, + "wallpaperSelector": { + "label": "Fond d'écran", + "tooltip": { + "action": "Clic gauche : Ouvrir le sélecteur de fond d'écran\nClic droit : Définir un fond d'écran aléatoire" + } + }, + "keepAwake": { + "label": { + "enabled": "Rester éveillé", + "disabled": "Rester éveillé" + }, + "tooltip": { + "action": "Cliquer pour basculer le mode Rester éveillé" + } + } + }, "toast": { "night-light": { "enabled": "Activé", diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index ca66a0b4..4dcb10c7 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -706,8 +706,52 @@ "description": "Configure e gerencie os widgets do centro de controle e suas opções de exibição." } } + }, + "quickSettings": { + "notifications": { + "label": "Notificações", + "tooltip": { + "enable": "Ativar Não perturbe", + "disable": "Desativar Não perturbe" + } }, - "hooks": { + "wifi": { + "label": { + "wifi": "Wi-Fi", + "ethernet": "Rede" + }, + "tooltip": { + "wifi": { + "connected": "Wi-Fi conectado", + "disconnected": "Wi-Fi desconectado" + }, + "ethernet": { + "connected": "Ethernet conectado" + } + } + }, + "bluetooth": { + "label": "Bluetooth", + "tooltip": { + "enabled": "Bluetooth habilitado", + "disabled": "Bluetooth desabilitado" + } + }, + "screenRecorder": { + "label": "Tela", + "tooltip": { + "start": "Iniciar gravação de tela", + "stop": "Parar gravação" + } + }, + "powerProfile": { + "tooltip": { + "current": "Atual: {profile}", + "unavailable": "Perfis de energia não disponíveis" + } + } + }, + "hooks": { "title": "Hooks", "system-hooks": { "section": { @@ -1400,6 +1444,78 @@ "restart": "Reiniciar", "suspend": "Suspender" }, + "quickSettings": { + "notifications": { + "label": { + "enabled": "Notificações", + "disabled": "Não perturbar" + }, + "tooltip": { + "action": "Clique esquerdo: Abrir histórico de notificações\nClique direito: Alternar Não perturbar" + } + }, + "screenRecorder": { + "label": { + "recording": "Parar", + "stopped": "Gravar" + }, + "tooltip": { + "action": "Clique para iniciar/parar a gravação da tela" + } + }, + "powerProfile": { + "label": { + "unavailable": "Perfil de energia" + }, + "tooltip": { + "action": "Clique para alternar o perfil de energia" + } + }, + "wifi": { + "label": { + "ethernet": "Ethernet", + "wifi": "Wi-Fi", + "disconnected": "Wi-Fi desconectado" + }, + "tooltip": { + "action": "Clique para gerenciar conexões Wi-Fi" + } + }, + "bluetooth": { + "label": { + "enabled": "Bluetooth", + "disabled": "Bluetooth" + }, + "tooltip": { + "action": "Clique para gerenciar dispositivos Bluetooth" + } + }, + "nightLight": { + "label": { + "enabled": "Luz noturna", + "forced": "Luz noturna", + "disabled": "Luz noturna" + }, + "tooltip": { + "action": "Clique para alternar o modo Luz noturna\nClique direito: Abrir configurações" + } + }, + "wallpaperSelector": { + "label": "Papel de parede", + "tooltip": { + "action": "Clique esquerdo: Abrir seletor de papel de parede\nClique direito: Definir papel de parede aleatório" + } + }, + "keepAwake": { + "label": { + "enabled": "Manter acordado", + "disabled": "Manter acordado" + }, + "tooltip": { + "action": "Clique para alternar o modo Manter acordado" + } + } + }, "toast": { "night-light": { "enabled": "Ativada", diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index f5ee975e..6b21676c 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -740,8 +740,52 @@ "description": "配置和管理控制中心小部件及其显示选项。" } } + }, + "quickSettings": { + "notifications": { + "label": "通知", + "tooltip": { + "enable": "开启勿扰模式", + "disable": "关闭勿扰模式" + } }, - "hooks": { + "wifi": { + "label": { + "wifi": "Wi-Fi", + "ethernet": "网络" + }, + "tooltip": { + "wifi": { + "connected": "Wi-Fi 已连接", + "disconnected": "Wi-Fi 已断开" + }, + "ethernet": { + "connected": "以太网已连接" + } + } + }, + "bluetooth": { + "label": "蓝牙", + "tooltip": { + "enabled": "蓝牙已启用", + "disabled": "蓝牙已禁用" + } + }, + "screenRecorder": { + "label": "屏幕录制", + "tooltip": { + "start": "开始屏幕录制", + "stop": "停止录制" + } + }, + "powerProfile": { + "tooltip": { + "current": "当前:{profile}", + "unavailable": "电源配置文件不可用" + } + } + }, + "hooks": { "title": "钩子", "system-hooks": { "section": { @@ -1400,6 +1444,78 @@ "restart": "重启", "suspend": "挂起" }, + "quickSettings": { + "notifications": { + "label": { + "enabled": "通知", + "disabled": "勿扰模式" + }, + "tooltip": { + "action": "左键:打开通知历史\n右键:切换勿扰模式" + } + }, + "screenRecorder": { + "label": { + "recording": "停止", + "stopped": "录制" + }, + "tooltip": { + "action": "点击开始/停止屏幕录制" + } + }, + "powerProfile": { + "label": { + "unavailable": "电源模式" + }, + "tooltip": { + "action": "点击切换电源模式" + } + }, + "wifi": { + "label": { + "ethernet": "以太网", + "wifi": "Wi-Fi", + "disconnected": "Wi-Fi 已断开" + }, + "tooltip": { + "action": "点击管理 Wi-Fi 连接" + } + }, + "bluetooth": { + "label": { + "enabled": "蓝牙", + "disabled": "蓝牙" + }, + "tooltip": { + "action": "点击管理蓝牙设备" + } + }, + "nightLight": { + "label": { + "enabled": "夜间模式", + "forced": "夜间模式", + "disabled": "夜间模式" + }, + "tooltip": { + "action": "点击切换夜间模式\n右键:打开设置" + } + }, + "wallpaperSelector": { + "label": "壁纸", + "tooltip": { + "action": "左键:打开壁纸选择器\n右键:设置随机壁纸" + } + }, + "keepAwake": { + "label": { + "enabled": "保持唤醒", + "disabled": "保持唤醒" + }, + "tooltip": { + "action": "点击切换保持唤醒模式" + } + } + }, "toast": { "night-light": { "enabled": "已启用", diff --git a/Assets/settings-default.json b/Assets/settings-default.json index 05675bd4..fd3707c4 100644 --- a/Assets/settings-default.json +++ b/Assets/settings-default.json @@ -123,7 +123,7 @@ "id": "Bluetooth" }, { - "id": "DoNotDisturb" + "id": "Notifications" }, { "id": "NightLight" diff --git a/Commons/I18n.qml b/Commons/I18n.qml index 3a013c57..11180047 100644 --- a/Commons/I18n.qml +++ b/Commons/I18n.qml @@ -54,6 +54,9 @@ Singleton { var data = JSON.parse(text()) root.translations = data Logger.log("I18n", `Loaded translations for "${root.langCode}"`) + if (debug) { + Logger.log("I18n", `Available root keys: ${Object.keys(data).join(", ")}`) + } root.isLoaded = true root.translationsLoaded() @@ -279,9 +282,9 @@ Singleton { interpolations = {} if (!isLoaded) { - // if (debug) { - // Logger.warn("I18n", "Translations not loaded yet") - // } + if (debug) { + Logger.warn("I18n", "Translations not loaded yet") + } return key } @@ -291,12 +294,19 @@ Singleton { // Look-up translation in the active language var value = translations var notFound = false + if (debug) { + Logger.log("I18n", `Looking up key: "${key}"`) + } for (var i = 0; i < keys.length; i++) { if (value && typeof value === "object" && keys[i] in value) { value = value[keys[i]] + if (debug) { + Logger.log("I18n", `Found key part "${keys[i]}"`) + } } else { if (debug) { - Logger.warn("I18n", `Translation key "${key}" not found`) + Logger.warn("I18n", `Translation key "${key}" not found at part "${keys[i]}"`) + Logger.warn("I18n", `Available keys: ${Object.keys(value || {}).join(", ")}`) } notFound = true break diff --git a/Commons/Settings.qml b/Commons/Settings.qml index ae0a17cb..ffe9039a 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -250,7 +250,7 @@ Singleton { }, { "id": "Bluetooth" }, { - "id": "DoNotDisturb" + "id": "Notifications" }, { "id": "ScreenRecorder" }, { diff --git a/Modules/ControlCenter/Widgets/Bluetooth.qml b/Modules/ControlCenter/Widgets/Bluetooth.qml index 9b1cd17d..e44d9844 100644 --- a/Modules/ControlCenter/Widgets/Bluetooth.qml +++ b/Modules/ControlCenter/Widgets/Bluetooth.qml @@ -8,12 +8,12 @@ NQuickSetting { property ShellScreen screen property real scaling: 1.0 - text: "Bluetooth" + text: I18n.tr("quickSettings.bluetooth.label.enabled") fontSize: Style.fontSizeS * scaling fontWeight: Style.fontWeightMedium icon: BluetoothService.enabled ? "bluetooth" : "bluetooth-off" active: BluetoothService.enabled - tooltipText: BluetoothService.enabled ? "Bluetooth enabled" : "Bluetooth disabled" + tooltipText: I18n.tr("quickSettings.bluetooth.tooltip.action") style: Settings.data.controlCenter.quickSettingsStyle || "modern" onClicked: PanelService.getPanel("bluetoothPanel")?.toggle(this) diff --git a/Modules/ControlCenter/Widgets/KeepAwake.qml b/Modules/ControlCenter/Widgets/KeepAwake.qml index a254f8df..e384272a 100644 --- a/Modules/ControlCenter/Widgets/KeepAwake.qml +++ b/Modules/ControlCenter/Widgets/KeepAwake.qml @@ -8,12 +8,12 @@ NQuickSetting { property ShellScreen screen property real scaling: 1.0 - text: "Keep-awake" + text: I18n.tr("quickSettings.keepAwake.label.enabled") fontSize: Style.fontSizeS * scaling fontWeight: Style.fontWeightMedium icon: IdleInhibitorService.isInhibited ? "keep-awake-on" : "keep-awake-off" active: IdleInhibitorService.isInhibited - tooltipText: IdleInhibitorService.isInhibited ? "Disable keep-awake" : "Enable keep-awake" + tooltipText: I18n.tr("quickSettings.keepAwake.tooltip.action") style: Settings.data.controlCenter.quickSettingsStyle || "modern" onClicked: IdleInhibitorService.manualToggle() diff --git a/Modules/ControlCenter/Widgets/NightLight.qml b/Modules/ControlCenter/Widgets/NightLight.qml index 21077f37..a2d6bfc1 100644 --- a/Modules/ControlCenter/Widgets/NightLight.qml +++ b/Modules/ControlCenter/Widgets/NightLight.qml @@ -9,21 +9,13 @@ NQuickSetting { property real scaling: 1.0 enabled: ProgramCheckerService.wlsunsetAvailable - text: "Night Light" + text: I18n.tr("quickSettings.nightLight.label.enabled") fontSize: Style.fontSizeS * scaling fontWeight: Style.fontWeightMedium icon: Settings.data.nightLight.enabled ? (Settings.data.nightLight.forced ? "nightlight-forced" : "nightlight-on") : "nightlight-off" active: Settings.data.nightLight.enabled style: Settings.data.controlCenter.quickSettingsStyle || "modern" - tooltipText: { - if (!Settings.data.nightLight.enabled) { - return "Turn on Night Light" - } else if (Settings.data.nightLight.forced) { - return "Night Light forced on" - } else { - return "Turn off Night Light" - } - } + tooltipText: I18n.tr("quickSettings.nightLight.tooltip.action") onClicked: { if (!Settings.data.nightLight.enabled) { diff --git a/Modules/ControlCenter/Widgets/DoNotDisturb.qml b/Modules/ControlCenter/Widgets/Notifications.qml similarity index 51% rename from Modules/ControlCenter/Widgets/DoNotDisturb.qml rename to Modules/ControlCenter/Widgets/Notifications.qml index cc2a1d1a..131db7f9 100644 --- a/Modules/ControlCenter/Widgets/DoNotDisturb.qml +++ b/Modules/ControlCenter/Widgets/Notifications.qml @@ -8,13 +8,14 @@ NQuickSetting { property ShellScreen screen property real scaling: 1.0 - text: "Do not Disturb" + text: Settings.data.notifications.doNotDisturb ? I18n.tr("quickSettings.notifications.label.disabled") : I18n.tr("quickSettings.notifications.label.enabled") fontSize: Style.fontSizeS * scaling fontWeight: Style.fontWeightMedium icon: Settings.data.notifications.doNotDisturb ? "bell-off" : "bell" active: Settings.data.notifications.doNotDisturb - tooltipText: Settings.data.notifications.doNotDisturb ? "Turn off Do Not Disturb" : "Turn on Do Not Disturb" + tooltipText: I18n.tr("quickSettings.notifications.tooltip.action") style: Settings.data.controlCenter.quickSettingsStyle || "modern" - onClicked: Settings.data.notifications.doNotDisturb = !Settings.data.notifications.doNotDisturb + onClicked: PanelService.getPanel("notificationHistoryPanel")?.toggle(this) + onRightClicked: Settings.data.notifications.doNotDisturb = !Settings.data.notifications.doNotDisturb } diff --git a/Modules/ControlCenter/Widgets/PowerProfile.qml b/Modules/ControlCenter/Widgets/PowerProfile.qml index 2636d40e..1c57f9fa 100644 --- a/Modules/ControlCenter/Widgets/PowerProfile.qml +++ b/Modules/ControlCenter/Widgets/PowerProfile.qml @@ -12,12 +12,12 @@ NQuickSetting { readonly property bool hasPP: PowerProfileService.available enabled: hasPP - text: PowerProfileService.getName() + text: hasPP ? PowerProfileService.getName() : I18n.tr("quickSettings.powerProfile.label.unavailable") fontSize: Style.fontSizeS * scaling fontWeight: Style.fontWeightMedium icon: PowerProfileService.getIcon() active: hasPP - tooltipText: hasPP ? "Current: " + PowerProfileService.getName() : "Power profiles not available" + tooltipText: I18n.tr("quickSettings.powerProfile.tooltip.action") style: Settings.data.controlCenter.quickSettingsStyle || "modern" onClicked: { diff --git a/Modules/ControlCenter/Widgets/ScreenRecorder.qml b/Modules/ControlCenter/Widgets/ScreenRecorder.qml index 0523bf7e..a9560bdf 100644 --- a/Modules/ControlCenter/Widgets/ScreenRecorder.qml +++ b/Modules/ControlCenter/Widgets/ScreenRecorder.qml @@ -10,13 +10,17 @@ NQuickSetting { enabled: ProgramCheckerService.gpuScreenRecorderAvailable icon: "camera-video" - text: "Screen Rec." + text: ScreenRecorderService.isRecording ? I18n.tr("quickSettings.screenRecorder.label.recording") : I18n.tr("quickSettings.screenRecorder.label.stopped") fontSize: Style.fontSizeS * scaling fontWeight: Style.fontWeightMedium active: ScreenRecorderService.isRecording - tooltipText: ScreenRecorderService.isRecording ? "Stop recording" : "Start screen recording" + tooltipText: I18n.tr("quickSettings.screenRecorder.tooltip.action") style: Settings.data.controlCenter.quickSettingsStyle || "modern" + // Force hover state when recording to get hover colors + property bool originalHovered: hovered + hovered: ScreenRecorderService.isRecording || originalHovered + onClicked: { ScreenRecorderService.toggleRecording() if (!ScreenRecorderService.isRecording) { diff --git a/Modules/ControlCenter/Widgets/WallpaperSelector.qml b/Modules/ControlCenter/Widgets/WallpaperSelector.qml index 9ec4db51..a4639383 100644 --- a/Modules/ControlCenter/Widgets/WallpaperSelector.qml +++ b/Modules/ControlCenter/Widgets/WallpaperSelector.qml @@ -10,11 +10,11 @@ NQuickSetting { enabled: Settings.data.wallpaper.enabled icon: "wallpaper-selector" - text: "Wallpaper" + text: I18n.tr("quickSettings.wallpaperSelector.label") fontSize: Style.fontSizeS * scaling fontWeight: Style.fontWeightMedium active: Settings.data.wallpaper.enabled - tooltipText: "Open wallpaper selector" + tooltipText: I18n.tr("quickSettings.wallpaperSelector.tooltip.action") style: Settings.data.controlCenter.quickSettingsStyle || "modern" onClicked: PanelService.getPanel("wallpaperPanel")?.toggle(this) diff --git a/Modules/ControlCenter/Widgets/WiFi.qml b/Modules/ControlCenter/Widgets/WiFi.qml index 30a4f635..9d896a5c 100644 --- a/Modules/ControlCenter/Widgets/WiFi.qml +++ b/Modules/ControlCenter/Widgets/WiFi.qml @@ -31,9 +31,16 @@ NQuickSetting { text: { if (NetworkService.ethernetConnected) { - return "Network" + return I18n.tr("quickSettings.wifi.label.ethernet") } - return "Wi-Fi" + let connected = false + for (const net in NetworkService.networks) { + if (NetworkService.networks[net].connected) { + connected = true + break + } + } + return connected ? I18n.tr("quickSettings.wifi.label.wifi") : I18n.tr("quickSettings.wifi.label.disconnected") } fontSize: Style.fontSizeS * scaling @@ -56,19 +63,7 @@ NQuickSetting { } } - tooltipText: { - if (NetworkService.ethernetConnected) { - return "Ethernet connected" - } - let connected = false - for (const net in NetworkService.networks) { - if (NetworkService.networks[net].connected) { - connected = true - break - } - } - return connected ? "Wi-Fi connected" : "Wi-Fi disconnected" - } + tooltipText: I18n.tr("quickSettings.wifi.tooltip.action") onClicked: PanelService.getPanel("wifiPanel")?.toggle(this) } diff --git a/Modules/Settings/Tabs/ControlCenterTab.qml b/Modules/Settings/Tabs/ControlCenterTab.qml index fbc968f9..8b7fe265 100644 --- a/Modules/Settings/Tabs/ControlCenterTab.qml +++ b/Modules/Settings/Tabs/ControlCenterTab.qml @@ -84,7 +84,7 @@ ColumnLayout { // Quick Settings SectionEditor { - sectionName: "Quick Settings" + sectionName: I18n.tr("settings.control-center.quickSettings.sectionName") sectionId: "quickSettings" settingsDialogComponent: "" widgetRegistry: ControlCenterWidgetRegistry diff --git a/Services/ControlCenterWidgetRegistry.qml b/Services/ControlCenterWidgetRegistry.qml index 4ed3d2ae..ce2fcbf1 100644 --- a/Services/ControlCenterWidgetRegistry.qml +++ b/Services/ControlCenterWidgetRegistry.qml @@ -11,7 +11,7 @@ Singleton { // Widget registry object mapping widget names to components property var widgets: ({ "Bluetooth": bluetoothComponent, - "DoNotDisturb": doNotDisturbComponent, + "Notifications": notificationsComponent, "KeepAwake": keepAwakeComponent, "NightLight": nightLightComponent, "PowerProfile": powerProfileComponent, @@ -26,8 +26,8 @@ Singleton { property Component bluetoothComponent: Component { Bluetooth {} } - property Component doNotDisturbComponent: Component { - DoNotDisturb {} + property Component notificationsComponent: Component { + Notifications {} } property Component keepAwakeComponent: Component { KeepAwake {}