From 4d3d579bbe12835844d69acb812891149c48301f Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Tue, 24 Feb 2026 18:10:35 +0100 Subject: [PATCH] refactor: use xdg entry comment as page descriptions --- .../src/pages/applications/default_apps.rs | 2 +- .../pages/applications/legacy_applications.rs | 2 +- .../src/pages/applications/startup_apps.rs | 2 +- cosmic-settings/src/pages/bluetooth/mod.rs | 2 +- .../src/pages/desktop/appearance/mod.rs | 2 +- cosmic-settings/src/pages/desktop/dock/mod.rs | 2 +- .../src/pages/desktop/panel/mod.rs | 2 +- .../src/pages/desktop/wallpaper/mod.rs | 2 +- .../src/pages/desktop/window_management.rs | 2 +- .../src/pages/desktop/workspaces.rs | 2 +- cosmic-settings/src/pages/display/mod.rs | 2 +- .../src/pages/input/keyboard/mod.rs | 2 +- cosmic-settings/src/pages/input/mod.rs | 2 +- cosmic-settings/src/pages/input/mouse.rs | 2 +- cosmic-settings/src/pages/input/touchpad.rs | 2 +- cosmic-settings/src/pages/networking/mod.rs | 6 ++--- .../src/pages/networking/vpn/mod.rs | 2 +- cosmic-settings/src/pages/networking/wifi.rs | 2 +- cosmic-settings/src/pages/networking/wired.rs | 2 +- cosmic-settings/src/pages/power/mod.rs | 4 +-- cosmic-settings/src/pages/sound/mod.rs | 2 +- cosmic-settings/src/pages/system/about.rs | 2 +- cosmic-settings/src/pages/system/users/mod.rs | 2 +- cosmic-settings/src/pages/time/date.rs | 2 +- cosmic-settings/src/pages/time/mod.rs | 2 +- cosmic-settings/src/pages/time/region.rs | 2 +- i18n/en/cosmic_settings.ftl | 26 ++----------------- 27 files changed, 31 insertions(+), 53 deletions(-) diff --git a/cosmic-settings/src/pages/applications/default_apps.rs b/cosmic-settings/src/pages/applications/default_apps.rs index ea9a903..7079aec 100644 --- a/cosmic-settings/src/pages/applications/default_apps.rs +++ b/cosmic-settings/src/pages/applications/default_apps.rs @@ -103,7 +103,7 @@ impl page::Page for Page { fn info(&self) -> page::Info { page::Info::new("default-apps", "preferences-default-applications-symbolic") .title(fl!("default-apps")) - .description(fl!("default-apps", "desc")) + .description(fl!("xdg-entry-default-apps-comment")) } fn on_enter(&mut self) -> Task { diff --git a/cosmic-settings/src/pages/applications/legacy_applications.rs b/cosmic-settings/src/pages/applications/legacy_applications.rs index 4a94867..0e238a9 100644 --- a/cosmic-settings/src/pages/applications/legacy_applications.rs +++ b/cosmic-settings/src/pages/applications/legacy_applications.rs @@ -104,7 +104,7 @@ impl page::Page for Page { "preferences-X11-applications-symbolic", ) .title(fl!("legacy-applications")) - .description(fl!("legacy-applications", "desc")) + .description(fl!("xdg-entry-x11-applications-comment")) } fn on_enter(&mut self) -> Task { diff --git a/cosmic-settings/src/pages/applications/startup_apps.rs b/cosmic-settings/src/pages/applications/startup_apps.rs index da50a80..bbe4488 100644 --- a/cosmic-settings/src/pages/applications/startup_apps.rs +++ b/cosmic-settings/src/pages/applications/startup_apps.rs @@ -101,7 +101,7 @@ impl page::Page for Page { fn info(&self) -> Info { page::Info::new("startup-apps", "preferences-startup-applications-symbolic") .title(fl!("startup-apps")) - .description(fl!("startup-apps", "desc")) + .description(fl!("xdg-entry-startup-apps-comment")) } fn content( &self, diff --git a/cosmic-settings/src/pages/bluetooth/mod.rs b/cosmic-settings/src/pages/bluetooth/mod.rs index 4e22e42..c123323 100644 --- a/cosmic-settings/src/pages/bluetooth/mod.rs +++ b/cosmic-settings/src/pages/bluetooth/mod.rs @@ -167,7 +167,7 @@ impl page::Page for Page { fn info(&self) -> page::Info { page::Info::new("bluetooth", "bluetooth-symbolic") .title(fl!("bluetooth")) - .description(fl!("bluetooth", "desc")) + .description(fl!("xdg-entry-bluetooth-comment")) } fn content( diff --git a/cosmic-settings/src/pages/desktop/appearance/mod.rs b/cosmic-settings/src/pages/desktop/appearance/mod.rs index 855b4b5..a4a2512 100644 --- a/cosmic-settings/src/pages/desktop/appearance/mod.rs +++ b/cosmic-settings/src/pages/desktop/appearance/mod.rs @@ -720,7 +720,7 @@ impl page::Page for Page { fn info(&self) -> page::Info { page::Info::new("appearance", "preferences-appearance-symbolic") .title(fl!("appearance")) - .description(fl!("appearance", "desc")) + .description(fl!("xdg-entry-appearance-comment")) } fn on_enter(&mut self) -> Task { diff --git a/cosmic-settings/src/pages/desktop/dock/mod.rs b/cosmic-settings/src/pages/desktop/dock/mod.rs index 4df45dd..b4934c8 100644 --- a/cosmic-settings/src/pages/desktop/dock/mod.rs +++ b/cosmic-settings/src/pages/desktop/dock/mod.rs @@ -216,7 +216,7 @@ impl page::Page for Page { fn info(&self) -> page::Info { page::Info::new("dock", "preferences-dock-symbolic") .title(fl!("dock")) - .description(fl!("dock", "desc")) + .description(fl!("xdg-entry-dock-comment")) } fn on_enter(&mut self) -> Task { diff --git a/cosmic-settings/src/pages/desktop/panel/mod.rs b/cosmic-settings/src/pages/desktop/panel/mod.rs index ad5c087..4f98e64 100644 --- a/cosmic-settings/src/pages/desktop/panel/mod.rs +++ b/cosmic-settings/src/pages/desktop/panel/mod.rs @@ -137,7 +137,7 @@ impl page::Page for Page { fn info(&self) -> page::Info { page::Info::new("panel", "preferences-panel-symbolic") .title(fl!("panel")) - .description(fl!("panel", "desc")) + .description(fl!("xdg-entry-panel-comment")) } fn on_enter(&mut self) -> Task { diff --git a/cosmic-settings/src/pages/desktop/wallpaper/mod.rs b/cosmic-settings/src/pages/desktop/wallpaper/mod.rs index 69bb0d8..f15ab99 100644 --- a/cosmic-settings/src/pages/desktop/wallpaper/mod.rs +++ b/cosmic-settings/src/pages/desktop/wallpaper/mod.rs @@ -211,7 +211,7 @@ impl page::Page for Page { fn info(&self) -> page::Info { page::Info::new("wallpaper", "preferences-desktop-wallpaper-symbolic") .title(fl!("wallpaper")) - .description(fl!("wallpaper", "desc")) + .description(fl!("xdg-entry-wallpaper-comment")) } fn on_enter(&mut self) -> Task { diff --git a/cosmic-settings/src/pages/desktop/window_management.rs b/cosmic-settings/src/pages/desktop/window_management.rs index 7ab58c1..06b03d4 100644 --- a/cosmic-settings/src/pages/desktop/window_management.rs +++ b/cosmic-settings/src/pages/desktop/window_management.rs @@ -222,7 +222,7 @@ impl page::Page for Page { "preferences-window-management-symbolic", ) .title(fl!("window-management")) - .description(fl!("window-management", "desc")) + .description(fl!("xdg-entry-window-management-comment")) } } diff --git a/cosmic-settings/src/pages/desktop/workspaces.rs b/cosmic-settings/src/pages/desktop/workspaces.rs index 904620f..4d45535 100644 --- a/cosmic-settings/src/pages/desktop/workspaces.rs +++ b/cosmic-settings/src/pages/desktop/workspaces.rs @@ -95,7 +95,7 @@ impl page::Page for Page { fn info(&self) -> page::Info { page::Info::new("workspaces", "preferences-workspaces-symbolic") .title(fl!("workspaces")) - .description(fl!("workspaces", "desc")) + .description(fl!("xdg-entry-workspaces-comment")) } } diff --git a/cosmic-settings/src/pages/display/mod.rs b/cosmic-settings/src/pages/display/mod.rs index 7de2ef4..fbbbefd 100644 --- a/cosmic-settings/src/pages/display/mod.rs +++ b/cosmic-settings/src/pages/display/mod.rs @@ -231,7 +231,7 @@ impl page::Page for Page { fn info(&self) -> page::Info { page::Info::new("display", "preferences-desktop-display-symbolic") .title(fl!("display")) - .description(fl!("display", "desc")) + .description(fl!("xdg-entry-displays-comment")) } #[cfg(not(feature = "test"))] diff --git a/cosmic-settings/src/pages/input/keyboard/mod.rs b/cosmic-settings/src/pages/input/keyboard/mod.rs index 647d8ea..b32deb0 100644 --- a/cosmic-settings/src/pages/input/keyboard/mod.rs +++ b/cosmic-settings/src/pages/input/keyboard/mod.rs @@ -276,7 +276,7 @@ impl page::Page for Page { fn info(&self) -> page::Info { page::Info::new("keyboard", "input-keyboard-symbolic") .title(fl!("keyboard")) - .description(fl!("keyboard", "desc")) + .description(fl!("xdg-entry-keyboard-comment")) } fn context_drawer(&self) -> Option> { diff --git a/cosmic-settings/src/pages/input/mod.rs b/cosmic-settings/src/pages/input/mod.rs index e1b94d6..560f740 100644 --- a/cosmic-settings/src/pages/input/mod.rs +++ b/cosmic-settings/src/pages/input/mod.rs @@ -188,7 +188,7 @@ impl page::Page for Page { // XXX icon? page::Info::new("input-devices", "preferences-input-devices-symbolic") .title(fl!("input-devices")) - .description(fl!("input-devices", "desc")) + .description(fl!("xdg-entry-input-comment")) } } diff --git a/cosmic-settings/src/pages/input/mouse.rs b/cosmic-settings/src/pages/input/mouse.rs index bf6bb5b..145eba8 100644 --- a/cosmic-settings/src/pages/input/mouse.rs +++ b/cosmic-settings/src/pages/input/mouse.rs @@ -41,7 +41,7 @@ impl page::Page for Page { fn info(&self) -> page::Info { page::Info::new("mouse", "input-mouse-symbolic") .title(fl!("mouse")) - .description(fl!("mouse", "desc")) + .description(fl!("xdg-entry-mouse-comment")) } } diff --git a/cosmic-settings/src/pages/input/touchpad.rs b/cosmic-settings/src/pages/input/touchpad.rs index 3606c5f..40b2b91 100644 --- a/cosmic-settings/src/pages/input/touchpad.rs +++ b/cosmic-settings/src/pages/input/touchpad.rs @@ -52,7 +52,7 @@ impl page::Page for Page { fn info(&self) -> page::Info { page::Info::new("touchpad", "input-touchpad-symbolic") .title(fl!("touchpad")) - .description(fl!("touchpad", "desc")) + .description(fl!("xdg-entry-touchpad-comment")) } } diff --git a/cosmic-settings/src/pages/networking/mod.rs b/cosmic-settings/src/pages/networking/mod.rs index 5b5cfdf..9ec1182 100644 --- a/cosmic-settings/src/pages/networking/mod.rs +++ b/cosmic-settings/src/pages/networking/mod.rs @@ -84,9 +84,9 @@ impl page::Page for Page { sections: &mut SlotMap>, ) -> Option { crate::slab!(descriptions { - wifi_desc = fl!("connections-and-profiles", variant = "wifi"); - wired_desc = fl!("connections-and-profiles", variant = "wired"); - vpn_desc = fl!("connections-and-profiles", variant = "vpn"); + wifi_desc = fl!("xdg-entry-wireless-comment"); + wired_desc = fl!("xdg-entry-wired-comment"); + vpn_desc = fl!("xdg-entry-vpn-comment"); }); let device_list = Section::default().descriptions(descriptions).view::( diff --git a/cosmic-settings/src/pages/networking/vpn/mod.rs b/cosmic-settings/src/pages/networking/vpn/mod.rs index 16ccbe8..6c08c64 100644 --- a/cosmic-settings/src/pages/networking/vpn/mod.rs +++ b/cosmic-settings/src/pages/networking/vpn/mod.rs @@ -211,7 +211,7 @@ impl page::Page for Page { fn info(&self) -> cosmic_settings_page::Info { page::Info::new("vpn", "preferences-vpn-symbolic") .title(fl!("vpn")) - .description(fl!("connections-and-profiles", variant = "vpn")) + .description(fl!("xdg-entry-vpn-comment")) } fn content( diff --git a/cosmic-settings/src/pages/networking/wifi.rs b/cosmic-settings/src/pages/networking/wifi.rs index 6239e9b..9047b1f 100644 --- a/cosmic-settings/src/pages/networking/wifi.rs +++ b/cosmic-settings/src/pages/networking/wifi.rs @@ -157,7 +157,7 @@ impl page::Page for Page { fn info(&self) -> cosmic_settings_page::Info { page::Info::new("wifi", "preferences-wireless-symbolic") .title(fl!("wifi")) - .description(fl!("connections-and-profiles", variant = "wifi")) + .description(fl!("xdg-entry-wireless-comment")) } fn content( diff --git a/cosmic-settings/src/pages/networking/wired.rs b/cosmic-settings/src/pages/networking/wired.rs index b183a97..643a692 100644 --- a/cosmic-settings/src/pages/networking/wired.rs +++ b/cosmic-settings/src/pages/networking/wired.rs @@ -108,7 +108,7 @@ impl page::Page for Page { fn info(&self) -> cosmic_settings_page::Info { page::Info::new("wired", "preferences-wired-symbolic") .title(fl!("wired")) - .description(fl!("connections-and-profiles", variant = "wired")) + .description(fl!("xdg-entry-wired-comment")) } fn content( diff --git a/cosmic-settings/src/pages/power/mod.rs b/cosmic-settings/src/pages/power/mod.rs index f419840..42c610b 100644 --- a/cosmic-settings/src/pages/power/mod.rs +++ b/cosmic-settings/src/pages/power/mod.rs @@ -100,7 +100,7 @@ impl page::Page for Page { fn info(&self) -> page::Info { page::Info::new("power", "preferences-power-and-battery-symbolic") .title(fl!("power")) - .description(fl!("power", "desc")) + .description(fl!("xdg-entry-power-comment")) } fn content( @@ -492,7 +492,7 @@ fn connected_devices() -> Section { fn profiles() -> Section { let mut descriptions = Slab::new(); - let _power_desc = descriptions.insert(fl!("power", "desc")); + let _power_desc = descriptions.insert(fl!("xdg-entry-power-comment")); Section::default() .title(fl!("power-mode")) diff --git a/cosmic-settings/src/pages/sound/mod.rs b/cosmic-settings/src/pages/sound/mod.rs index 2b5cf44..b198932 100644 --- a/cosmic-settings/src/pages/sound/mod.rs +++ b/cosmic-settings/src/pages/sound/mod.rs @@ -125,7 +125,7 @@ impl page::Page for Page { fn info(&self) -> page::Info { page::Info::new("sound", "preferences-sound-symbolic") .title(fl!("sound")) - .description(fl!("sound", "desc")) + .description(fl!("xdg-entry-sound-comment")) } fn set_id(&mut self, entity: page::Entity) { diff --git a/cosmic-settings/src/pages/system/about.rs b/cosmic-settings/src/pages/system/about.rs index 7972a28..94c50c9 100644 --- a/cosmic-settings/src/pages/system/about.rs +++ b/cosmic-settings/src/pages/system/about.rs @@ -61,7 +61,7 @@ impl page::Page for Page { fn info(&self) -> page::Info { page::Info::new("about", "help-about-symbolic") .title(fl!("about")) - .description(fl!("about", "desc")) + .description(fl!("xdg-entry-about-comment")) } fn on_enter(&mut self) -> Task { diff --git a/cosmic-settings/src/pages/system/users/mod.rs b/cosmic-settings/src/pages/system/users/mod.rs index f2c07e0..11d5c01 100644 --- a/cosmic-settings/src/pages/system/users/mod.rs +++ b/cosmic-settings/src/pages/system/users/mod.rs @@ -200,7 +200,7 @@ impl page::Page for Page { fn info(&self) -> page::Info { page::Info::new("users", "system-users-symbolic") .title(fl!("users")) - .description(fl!("users", "desc")) + .description(fl!("xdg-entry-users-comment")) } fn dialog(&self) -> Option> { diff --git a/cosmic-settings/src/pages/time/date.rs b/cosmic-settings/src/pages/time/date.rs index 09ab475..5cfcf05 100644 --- a/cosmic-settings/src/pages/time/date.rs +++ b/cosmic-settings/src/pages/time/date.rs @@ -138,7 +138,7 @@ impl page::Page for Page { fn info(&self) -> page::Info { page::Info::new("time-date", "preferences-system-time-symbolic") .title(fl!("time-date")) - .description(fl!("time-date", "desc")) + .description(fl!("xdg-entry-date-time-comment")) } fn on_enter(&mut self) -> Task { diff --git a/cosmic-settings/src/pages/time/mod.rs b/cosmic-settings/src/pages/time/mod.rs index 76a3aee..ad7d106 100644 --- a/cosmic-settings/src/pages/time/mod.rs +++ b/cosmic-settings/src/pages/time/mod.rs @@ -21,7 +21,7 @@ impl page::Page for Page { fn info(&self) -> page::Info { page::Info::new("time", "preferences-time-and-language-symbolic") .title(fl!("time")) - .description(fl!("time", "desc")) + .description(fl!("xdg-entry-time-language-comment")) } } diff --git a/cosmic-settings/src/pages/time/region.rs b/cosmic-settings/src/pages/time/region.rs index 524cd67..3487682 100644 --- a/cosmic-settings/src/pages/time/region.rs +++ b/cosmic-settings/src/pages/time/region.rs @@ -142,7 +142,7 @@ impl page::Page for Page { fn info(&self) -> page::Info { page::Info::new("time-region", "preferences-region-and-language-symbolic") .title(fl!("time-region")) - .description(fl!("time-region", "desc")) + .description(fl!("xdg-entry-region-language-comment")) } fn on_enter(&mut self) -> cosmic::Task { diff --git a/i18n/en/cosmic_settings.ftl b/i18n/en/cosmic_settings.ftl index 0f2012d..6fb7232 100644 --- a/i18n/en/cosmic_settings.ftl +++ b/i18n/en/cosmic_settings.ftl @@ -135,6 +135,7 @@ xdg-entry-x11-applications-keywords = COSMIC;X11;Application;Game;Compatibility; ## Network & Wireless +# TODO: Remove? connections-and-profiles = { $variant -> [wired] Wired [wifi] Wi-Fi @@ -241,7 +242,6 @@ confirm = Confirm enable = Enable bluetooth = Bluetooth - .desc = Manage Bluetooth devices .status = This system is visible as { $aliases } while Bluetooth settings are open. .connected = Connected .connecting = Connecting @@ -316,7 +316,6 @@ desktop = Desktop wallpaper = Wallpaper .change = Change image every - .desc = Wallpaper images, colors, and slideshow options .fit = Wallpaper fit .folder-dialog = Choose wallpaper folder .image-dialog = Choose wallpaper image @@ -347,7 +346,6 @@ never = Never ## Desktop: Appearance appearance = Appearance - .desc = Accent colors and theming accent-color = Accent color app-background = Window background @@ -425,12 +423,10 @@ shadow-and-corners = Window shadow and corners ## Desktop: Notifications notifications = Notifications - .desc = Do Not Disturb, lockscreen notifications, and per-application settings ## Desktop: Panel panel = Panel - .desc = Primary system bar for menus and applets add = Add add-applet = Add applet @@ -480,12 +476,10 @@ panel-missing = Panel configuration is missing ## Desktop: Dock dock = Dock - .desc = An optional bar for apps and applets ## Desktop: Window management window-management = Window management - .desc = Super key action, window control options, and additional window tiling options super-key = Super key action .launcher = Open Launcher @@ -508,7 +502,6 @@ focus-navigation = Focus navigation ## Desktop: Workspaces workspaces = Workspaces - .desc = Workspace orientation and behavior workspaces-overview = Workspaces overview .action-on-typing = Action on typing @@ -548,7 +541,6 @@ color = Color .temperature = Color temperature display = Displays - .desc = Manage displays and night light .arrangement = Display arrangement .arrangement-desc = Drag displays to rearrange them .enable = Enable display @@ -601,7 +593,6 @@ dialog = Dialog ## Sound sound = Sound - .desc = N/A sound-output = Output .volume = Output volume @@ -637,7 +628,6 @@ sound-device-profiles = Device profiles # Power & Battery settings page power = Power & battery - .desc = Manage power settings battery = Battery .minute = { $value } { $value -> @@ -684,7 +674,7 @@ acceleration-desc = Automatically adjusts tracking sensitivity based on speed disable-while-typing = Disable while typing input-devices = Input devices - .desc = Input devices + primary-button = Primary button .desc = Sets the order of physical buttons @@ -705,7 +695,6 @@ fast = Fast short = Short long = Long keyboard = Keyboard - .desc = Input sources, switching, special character entry, shortcuts keyboard-sources = Input Sources .desc = Input sources can be switched using Super+Space key combination. This can be customized in the keyboard shortcut settings. @@ -877,7 +866,6 @@ zoom-out = Zoom Out ## Input: Mouse mouse = Mouse - .desc = Mouse speed, acceleration, natural scrolling .speed = Mouse speed .acceleration = Enable mouse acceleration @@ -895,7 +883,6 @@ tap-to-click = Tap to click touchpad = Touchpad .acceleration = Enable touchpad acceleration - .desc = Touchpad speed, click options, gestures .speed = Touchpad speed ## Input: Gestures @@ -918,10 +905,8 @@ open-workspaces-view = Open Workspaces Overview ## Time & language time = Time & language - .desc = N/A time-date = Date & time - .desc = Time zone, automatic clock settings, and time formatting .auto = Set automatically .auto-ntp = Date & time will update automatically when the time zone is set @@ -940,7 +925,6 @@ time-format = Date & time format .monday = Monday time-region = Region & language - .desc = Format dates, times, and numbers based on your region formatting = Formatting .dates = Dates @@ -965,7 +949,6 @@ applications = Applications ## Applications: Default applications default-apps = Default Applications - .desc = Default web browser, mail client, file browser, and other applications .web-browser = Web browser .file-manager = File manager .mail-client = Mail client @@ -982,7 +965,6 @@ default-apps = Default Applications ## Applications: Startup applications startup-apps = Startup applications - .desc = Configure applications which run on login .add = Add app .user = Applications launched when you log in .none = No startup applications added @@ -993,7 +975,6 @@ startup-apps = Startup applications ## Applications: Legacy applications legacy-applications = X11 applications compatibility - .desc = X11 Window system application scaling and Global shortcuts legacy-app-global-shortcuts = Global shortcuts in X11 applications .desc = Global shortcuts allows keystrokes and mouse button events performed in applications to be recognized by other applications for features like push-to-talk or push-to-mute. By default, Global shortcuts is disabled in X11 applications to ensure other applications can’t monitor for keyboard and mouse events containing sensitive information. @@ -1020,7 +1001,6 @@ system = System & accounts ## System: About about = About - .desc = Device name, hardware information, operating system defaults about-device = Device name .desc = This name appears to other network or Bluetooth devices @@ -1045,12 +1025,10 @@ about-related = Related settings ## System: Firmware firmware = Firmware - .desc = Firmware details ## System: Users users = Users - .desc = Authentication and user accounts .admin = Admin .standard = Standard .profile-add = Choose profile image