refactor: use xdg entry comment as page descriptions

This commit is contained in:
Michael Aaron Murphy 2026-02-24 18:10:35 +01:00 • committed by Jeremy Soller
parent d1224aaa5e
commit 4d3d579bbe
27 changed files with 31 additions and 53 deletions

View file

@ -103,7 +103,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> page::Info { fn info(&self) -> page::Info {
page::Info::new("default-apps", "preferences-default-applications-symbolic") page::Info::new("default-apps", "preferences-default-applications-symbolic")
.title(fl!("default-apps")) .title(fl!("default-apps"))
.description(fl!("default-apps", "desc")) .description(fl!("xdg-entry-default-apps-comment"))
} }
fn on_enter(&mut self) -> Task<crate::pages::Message> { fn on_enter(&mut self) -> Task<crate::pages::Message> {

View file

@ -104,7 +104,7 @@ impl page::Page<crate::pages::Message> for Page {
"preferences-X11-applications-symbolic", "preferences-X11-applications-symbolic",
) )
.title(fl!("legacy-applications")) .title(fl!("legacy-applications"))
.description(fl!("legacy-applications", "desc")) .description(fl!("xdg-entry-x11-applications-comment"))
} }
fn on_enter(&mut self) -> Task<crate::pages::Message> { fn on_enter(&mut self) -> Task<crate::pages::Message> {

View file

@ -101,7 +101,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> Info { fn info(&self) -> Info {
page::Info::new("startup-apps", "preferences-startup-applications-symbolic") page::Info::new("startup-apps", "preferences-startup-applications-symbolic")
.title(fl!("startup-apps")) .title(fl!("startup-apps"))
.description(fl!("startup-apps", "desc")) .description(fl!("xdg-entry-startup-apps-comment"))
} }
fn content( fn content(
&self, &self,

View file

@ -167,7 +167,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> page::Info { fn info(&self) -> page::Info {
page::Info::new("bluetooth", "bluetooth-symbolic") page::Info::new("bluetooth", "bluetooth-symbolic")
.title(fl!("bluetooth")) .title(fl!("bluetooth"))
.description(fl!("bluetooth", "desc")) .description(fl!("xdg-entry-bluetooth-comment"))
} }
fn content( fn content(

View file

@ -720,7 +720,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> page::Info { fn info(&self) -> page::Info {
page::Info::new("appearance", "preferences-appearance-symbolic") page::Info::new("appearance", "preferences-appearance-symbolic")
.title(fl!("appearance")) .title(fl!("appearance"))
.description(fl!("appearance", "desc")) .description(fl!("xdg-entry-appearance-comment"))
} }
fn on_enter(&mut self) -> Task<crate::pages::Message> { fn on_enter(&mut self) -> Task<crate::pages::Message> {

View file

@ -216,7 +216,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> page::Info { fn info(&self) -> page::Info {
page::Info::new("dock", "preferences-dock-symbolic") page::Info::new("dock", "preferences-dock-symbolic")
.title(fl!("dock")) .title(fl!("dock"))
.description(fl!("dock", "desc")) .description(fl!("xdg-entry-dock-comment"))
} }
fn on_enter(&mut self) -> Task<crate::pages::Message> { fn on_enter(&mut self) -> Task<crate::pages::Message> {

View file

@ -137,7 +137,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> page::Info { fn info(&self) -> page::Info {
page::Info::new("panel", "preferences-panel-symbolic") page::Info::new("panel", "preferences-panel-symbolic")
.title(fl!("panel")) .title(fl!("panel"))
.description(fl!("panel", "desc")) .description(fl!("xdg-entry-panel-comment"))
} }
fn on_enter(&mut self) -> Task<crate::pages::Message> { fn on_enter(&mut self) -> Task<crate::pages::Message> {

View file

@ -211,7 +211,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> page::Info { fn info(&self) -> page::Info {
page::Info::new("wallpaper", "preferences-desktop-wallpaper-symbolic") page::Info::new("wallpaper", "preferences-desktop-wallpaper-symbolic")
.title(fl!("wallpaper")) .title(fl!("wallpaper"))
.description(fl!("wallpaper", "desc")) .description(fl!("xdg-entry-wallpaper-comment"))
} }
fn on_enter(&mut self) -> Task<crate::pages::Message> { fn on_enter(&mut self) -> Task<crate::pages::Message> {

View file

@ -222,7 +222,7 @@ impl page::Page<crate::pages::Message> for Page {
"preferences-window-management-symbolic", "preferences-window-management-symbolic",
) )
.title(fl!("window-management")) .title(fl!("window-management"))
.description(fl!("window-management", "desc")) .description(fl!("xdg-entry-window-management-comment"))
} }
} }

View file

@ -95,7 +95,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> page::Info { fn info(&self) -> page::Info {
page::Info::new("workspaces", "preferences-workspaces-symbolic") page::Info::new("workspaces", "preferences-workspaces-symbolic")
.title(fl!("workspaces")) .title(fl!("workspaces"))
.description(fl!("workspaces", "desc")) .description(fl!("xdg-entry-workspaces-comment"))
} }
} }

View file

@ -231,7 +231,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> page::Info { fn info(&self) -> page::Info {
page::Info::new("display", "preferences-desktop-display-symbolic") page::Info::new("display", "preferences-desktop-display-symbolic")
.title(fl!("display")) .title(fl!("display"))
.description(fl!("display", "desc")) .description(fl!("xdg-entry-displays-comment"))
} }
#[cfg(not(feature = "test"))] #[cfg(not(feature = "test"))]

View file

@ -276,7 +276,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> page::Info { fn info(&self) -> page::Info {
page::Info::new("keyboard", "input-keyboard-symbolic") page::Info::new("keyboard", "input-keyboard-symbolic")
.title(fl!("keyboard")) .title(fl!("keyboard"))
.description(fl!("keyboard", "desc")) .description(fl!("xdg-entry-keyboard-comment"))
} }
fn context_drawer(&self) -> Option<ContextDrawer<'_, crate::pages::Message>> { fn context_drawer(&self) -> Option<ContextDrawer<'_, crate::pages::Message>> {

View file

@ -188,7 +188,7 @@ impl page::Page<crate::pages::Message> for Page {
// XXX icon? // XXX icon?
page::Info::new("input-devices", "preferences-input-devices-symbolic") page::Info::new("input-devices", "preferences-input-devices-symbolic")
.title(fl!("input-devices")) .title(fl!("input-devices"))
.description(fl!("input-devices", "desc")) .description(fl!("xdg-entry-input-comment"))
} }
} }

View file

@ -41,7 +41,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> page::Info { fn info(&self) -> page::Info {
page::Info::new("mouse", "input-mouse-symbolic") page::Info::new("mouse", "input-mouse-symbolic")
.title(fl!("mouse")) .title(fl!("mouse"))
.description(fl!("mouse", "desc")) .description(fl!("xdg-entry-mouse-comment"))
} }
} }

View file

@ -52,7 +52,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> page::Info { fn info(&self) -> page::Info {
page::Info::new("touchpad", "input-touchpad-symbolic") page::Info::new("touchpad", "input-touchpad-symbolic")
.title(fl!("touchpad")) .title(fl!("touchpad"))
.description(fl!("touchpad", "desc")) .description(fl!("xdg-entry-touchpad-comment"))
} }
} }

View file

@ -84,9 +84,9 @@ impl page::Page<crate::pages::Message> for Page {
sections: &mut SlotMap<section::Entity, Section<crate::pages::Message>>, sections: &mut SlotMap<section::Entity, Section<crate::pages::Message>>,
) -> Option<page::Content> { ) -> Option<page::Content> {
crate::slab!(descriptions { crate::slab!(descriptions {
wifi_desc = fl!("connections-and-profiles", variant = "wifi"); wifi_desc = fl!("xdg-entry-wireless-comment");
wired_desc = fl!("connections-and-profiles", variant = "wired"); wired_desc = fl!("xdg-entry-wired-comment");
vpn_desc = fl!("connections-and-profiles", variant = "vpn"); vpn_desc = fl!("xdg-entry-vpn-comment");
}); });
let device_list = Section::default().descriptions(descriptions).view::<Self>( let device_list = Section::default().descriptions(descriptions).view::<Self>(

View file

@ -211,7 +211,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> cosmic_settings_page::Info { fn info(&self) -> cosmic_settings_page::Info {
page::Info::new("vpn", "preferences-vpn-symbolic") page::Info::new("vpn", "preferences-vpn-symbolic")
.title(fl!("vpn")) .title(fl!("vpn"))
.description(fl!("connections-and-profiles", variant = "vpn")) .description(fl!("xdg-entry-vpn-comment"))
} }
fn content( fn content(

View file

@ -157,7 +157,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> cosmic_settings_page::Info { fn info(&self) -> cosmic_settings_page::Info {
page::Info::new("wifi", "preferences-wireless-symbolic") page::Info::new("wifi", "preferences-wireless-symbolic")
.title(fl!("wifi")) .title(fl!("wifi"))
.description(fl!("connections-and-profiles", variant = "wifi")) .description(fl!("xdg-entry-wireless-comment"))
} }
fn content( fn content(

View file

@ -108,7 +108,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> cosmic_settings_page::Info { fn info(&self) -> cosmic_settings_page::Info {
page::Info::new("wired", "preferences-wired-symbolic") page::Info::new("wired", "preferences-wired-symbolic")
.title(fl!("wired")) .title(fl!("wired"))
.description(fl!("connections-and-profiles", variant = "wired")) .description(fl!("xdg-entry-wired-comment"))
} }
fn content( fn content(

View file

@ -100,7 +100,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> page::Info { fn info(&self) -> page::Info {
page::Info::new("power", "preferences-power-and-battery-symbolic") page::Info::new("power", "preferences-power-and-battery-symbolic")
.title(fl!("power")) .title(fl!("power"))
.description(fl!("power", "desc")) .description(fl!("xdg-entry-power-comment"))
} }
fn content( fn content(
@ -492,7 +492,7 @@ fn connected_devices() -> Section<crate::pages::Message> {
fn profiles() -> Section<crate::pages::Message> { fn profiles() -> Section<crate::pages::Message> {
let mut descriptions = Slab::new(); 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() Section::default()
.title(fl!("power-mode")) .title(fl!("power-mode"))

View file

@ -125,7 +125,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> page::Info { fn info(&self) -> page::Info {
page::Info::new("sound", "preferences-sound-symbolic") page::Info::new("sound", "preferences-sound-symbolic")
.title(fl!("sound")) .title(fl!("sound"))
.description(fl!("sound", "desc")) .description(fl!("xdg-entry-sound-comment"))
} }
fn set_id(&mut self, entity: page::Entity) { fn set_id(&mut self, entity: page::Entity) {

View file

@ -61,7 +61,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> page::Info { fn info(&self) -> page::Info {
page::Info::new("about", "help-about-symbolic") page::Info::new("about", "help-about-symbolic")
.title(fl!("about")) .title(fl!("about"))
.description(fl!("about", "desc")) .description(fl!("xdg-entry-about-comment"))
} }
fn on_enter(&mut self) -> Task<crate::pages::Message> { fn on_enter(&mut self) -> Task<crate::pages::Message> {

View file

@ -200,7 +200,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> page::Info { fn info(&self) -> page::Info {
page::Info::new("users", "system-users-symbolic") page::Info::new("users", "system-users-symbolic")
.title(fl!("users")) .title(fl!("users"))
.description(fl!("users", "desc")) .description(fl!("xdg-entry-users-comment"))
} }
fn dialog(&self) -> Option<Element<'_, pages::Message>> { fn dialog(&self) -> Option<Element<'_, pages::Message>> {

View file

@ -138,7 +138,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> page::Info { fn info(&self) -> page::Info {
page::Info::new("time-date", "preferences-system-time-symbolic") page::Info::new("time-date", "preferences-system-time-symbolic")
.title(fl!("time-date")) .title(fl!("time-date"))
.description(fl!("time-date", "desc")) .description(fl!("xdg-entry-date-time-comment"))
} }
fn on_enter(&mut self) -> Task<crate::pages::Message> { fn on_enter(&mut self) -> Task<crate::pages::Message> {

View file

@ -21,7 +21,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> page::Info { fn info(&self) -> page::Info {
page::Info::new("time", "preferences-time-and-language-symbolic") page::Info::new("time", "preferences-time-and-language-symbolic")
.title(fl!("time")) .title(fl!("time"))
.description(fl!("time", "desc")) .description(fl!("xdg-entry-time-language-comment"))
} }
} }

View file

@ -142,7 +142,7 @@ impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> page::Info { fn info(&self) -> page::Info {
page::Info::new("time-region", "preferences-region-and-language-symbolic") page::Info::new("time-region", "preferences-region-and-language-symbolic")
.title(fl!("time-region")) .title(fl!("time-region"))
.description(fl!("time-region", "desc")) .description(fl!("xdg-entry-region-language-comment"))
} }
fn on_enter(&mut self) -> cosmic::Task<crate::pages::Message> { fn on_enter(&mut self) -> cosmic::Task<crate::pages::Message> {

View file

@ -135,6 +135,7 @@ xdg-entry-x11-applications-keywords = COSMIC;X11;Application;Game;Compatibility;
## Network & Wireless ## Network & Wireless
# TODO: Remove?
connections-and-profiles = { $variant -> connections-and-profiles = { $variant ->
[wired] Wired [wired] Wired
[wifi] Wi-Fi [wifi] Wi-Fi
@ -241,7 +242,6 @@ confirm = Confirm
enable = Enable enable = Enable
bluetooth = Bluetooth bluetooth = Bluetooth
.desc = Manage Bluetooth devices
.status = This system is visible as { $aliases } while Bluetooth settings are open. .status = This system is visible as { $aliases } while Bluetooth settings are open.
.connected = Connected .connected = Connected
.connecting = Connecting .connecting = Connecting
@ -316,7 +316,6 @@ desktop = Desktop
wallpaper = Wallpaper wallpaper = Wallpaper
.change = Change image every .change = Change image every
.desc = Wallpaper images, colors, and slideshow options
.fit = Wallpaper fit .fit = Wallpaper fit
.folder-dialog = Choose wallpaper folder .folder-dialog = Choose wallpaper folder
.image-dialog = Choose wallpaper image .image-dialog = Choose wallpaper image
@ -347,7 +346,6 @@ never = Never
## Desktop: Appearance ## Desktop: Appearance
appearance = Appearance appearance = Appearance
.desc = Accent colors and theming
accent-color = Accent color accent-color = Accent color
app-background = Window background app-background = Window background
@ -425,12 +423,10 @@ shadow-and-corners = Window shadow and corners
## Desktop: Notifications ## Desktop: Notifications
notifications = Notifications notifications = Notifications
.desc = Do Not Disturb, lockscreen notifications, and per-application settings
## Desktop: Panel ## Desktop: Panel
panel = Panel panel = Panel
.desc = Primary system bar for menus and applets
add = Add add = Add
add-applet = Add applet add-applet = Add applet
@ -480,12 +476,10 @@ panel-missing = Panel configuration is missing
## Desktop: Dock ## Desktop: Dock
dock = Dock dock = Dock
.desc = An optional bar for apps and applets
## Desktop: Window management ## Desktop: Window management
window-management = Window management window-management = Window management
.desc = Super key action, window control options, and additional window tiling options
super-key = Super key action super-key = Super key action
.launcher = Open Launcher .launcher = Open Launcher
@ -508,7 +502,6 @@ focus-navigation = Focus navigation
## Desktop: Workspaces ## Desktop: Workspaces
workspaces = Workspaces workspaces = Workspaces
.desc = Workspace orientation and behavior
workspaces-overview = Workspaces overview workspaces-overview = Workspaces overview
.action-on-typing = Action on typing .action-on-typing = Action on typing
@ -548,7 +541,6 @@ color = Color
.temperature = Color temperature .temperature = Color temperature
display = Displays display = Displays
.desc = Manage displays and night light
.arrangement = Display arrangement .arrangement = Display arrangement
.arrangement-desc = Drag displays to rearrange them .arrangement-desc = Drag displays to rearrange them
.enable = Enable display .enable = Enable display
@ -601,7 +593,6 @@ dialog = Dialog
## Sound ## Sound
sound = Sound sound = Sound
.desc = N/A
sound-output = Output sound-output = Output
.volume = Output volume .volume = Output volume
@ -637,7 +628,6 @@ sound-device-profiles = Device profiles
# Power & Battery settings page # Power & Battery settings page
power = Power & battery power = Power & battery
.desc = Manage power settings
battery = Battery battery = Battery
.minute = { $value } { $value -> .minute = { $value } { $value ->
@ -684,7 +674,7 @@ acceleration-desc = Automatically adjusts tracking sensitivity based on speed
disable-while-typing = Disable while typing disable-while-typing = Disable while typing
input-devices = Input devices input-devices = Input devices
.desc = Input devices
primary-button = Primary button primary-button = Primary button
.desc = Sets the order of physical buttons .desc = Sets the order of physical buttons
@ -705,7 +695,6 @@ fast = Fast
short = Short short = Short
long = Long long = Long
keyboard = Keyboard keyboard = Keyboard
.desc = Input sources, switching, special character entry, shortcuts
keyboard-sources = Input Sources keyboard-sources = Input Sources
.desc = Input sources can be switched using Super+Space key combination. This can be customized in the keyboard shortcut settings. .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 ## Input: Mouse
mouse = Mouse mouse = Mouse
.desc = Mouse speed, acceleration, natural scrolling
.speed = Mouse speed .speed = Mouse speed
.acceleration = Enable mouse acceleration .acceleration = Enable mouse acceleration
@ -895,7 +883,6 @@ tap-to-click = Tap to click
touchpad = Touchpad touchpad = Touchpad
.acceleration = Enable touchpad acceleration .acceleration = Enable touchpad acceleration
.desc = Touchpad speed, click options, gestures
.speed = Touchpad speed .speed = Touchpad speed
## Input: Gestures ## Input: Gestures
@ -918,10 +905,8 @@ open-workspaces-view = Open Workspaces Overview
## Time & language ## Time & language
time = Time & language time = Time & language
.desc = N/A
time-date = Date & time time-date = Date & time
.desc = Time zone, automatic clock settings, and time formatting
.auto = Set automatically .auto = Set automatically
.auto-ntp = Date & time will update automatically when the time zone is set .auto-ntp = Date & time will update automatically when the time zone is set
@ -940,7 +925,6 @@ time-format = Date & time format
.monday = Monday .monday = Monday
time-region = Region & language time-region = Region & language
.desc = Format dates, times, and numbers based on your region
formatting = Formatting formatting = Formatting
.dates = Dates .dates = Dates
@ -965,7 +949,6 @@ applications = Applications
## Applications: Default applications ## Applications: Default applications
default-apps = Default Applications default-apps = Default Applications
.desc = Default web browser, mail client, file browser, and other applications
.web-browser = Web browser .web-browser = Web browser
.file-manager = File manager .file-manager = File manager
.mail-client = Mail client .mail-client = Mail client
@ -982,7 +965,6 @@ default-apps = Default Applications
## Applications: Startup applications ## Applications: Startup applications
startup-apps = Startup applications startup-apps = Startup applications
.desc = Configure applications which run on login
.add = Add app .add = Add app
.user = Applications launched when you log in .user = Applications launched when you log in
.none = No startup applications added .none = No startup applications added
@ -993,7 +975,6 @@ startup-apps = Startup applications
## Applications: Legacy applications ## Applications: Legacy applications
legacy-applications = X11 applications compatibility legacy-applications = X11 applications compatibility
.desc = X11 Window system application scaling and Global shortcuts
legacy-app-global-shortcuts = Global shortcuts in X11 applications 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. .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 ## System: About
about = About about = About
.desc = Device name, hardware information, operating system defaults
about-device = Device name about-device = Device name
.desc = This name appears to other network or Bluetooth devices .desc = This name appears to other network or Bluetooth devices
@ -1045,12 +1025,10 @@ about-related = Related settings
## System: Firmware ## System: Firmware
firmware = Firmware firmware = Firmware
.desc = Firmware details
## System: Users ## System: Users
users = Users users = Users
.desc = Authentication and user accounts
.admin = Admin .admin = Admin
.standard = Standard .standard = Standard
.profile-add = Choose profile image .profile-add = Choose profile image