chore(cargo): switch lichen-system dep to locales-rs

Fixes #1049
This commit is contained in:
Michael Aaron Murphy 2025-03-13 20:32:59 +01:00
parent d2c1756c86
commit 9fb29f0a2a
No known key found for this signature in database
GPG key ID: B2732D4240C9212C
3 changed files with 18 additions and 67 deletions

View file

@ -101,9 +101,8 @@ version = "0.15.3"
features = ["fluent-system", "desktop-requester"]
# Contains region-handling logic for Linux
[dependencies.lichen-system]
git = "https://github.com/serpent-os/lichen"
package = "system"
[dependencies.locales-rs]
git = "https://github.com/AerynOS/locales-rs"
optional = true
[features]
@ -165,7 +164,7 @@ page-networking = [
page-power = ["dep:upower_dbus", "dep:zbus"]
page-region = [
"gettext",
"dep:lichen-system",
"dep:locales-rs",
"dep:locale1",
"dep:zbus",
]

View file

@ -21,7 +21,7 @@ use icu::datetime::options::preferences;
use icu::datetime::DateTimeFormatter;
use icu::decimal::options::FixedDecimalFormatterOptions;
use icu::decimal::FixedDecimalFormatter;
use lichen_system::locale;
use locales_rs as locale;
use slotmap::{DefaultKey, SlotMap};
#[derive(Clone, Debug)]
@ -849,7 +849,7 @@ fn language_element(
widget::settings::item(description, popover_button(id, expanded)).into()
}
fn localized_iso_codes(locale: &lichen_system::locale::Locale) -> (String, String) {
fn localized_iso_codes(locale: &locale::Locale) -> (String, String) {
let mut language = gettextrs::dgettext("iso_639", &locale.language.display_name);
let country = gettextrs::dgettext("iso_3166", &locale.territory.display_name);
@ -862,7 +862,7 @@ fn localized_iso_codes(locale: &lichen_system::locale::Locale) -> (String, Strin
(language, country)
}
fn localized_locale(locale: &lichen_system::locale::Locale, lang_code: String) -> SystemLocale {
fn localized_locale(locale: &locale::Locale, lang_code: String) -> SystemLocale {
let (language, country) = localized_iso_codes(locale);
SystemLocale {