build: migrate to Dioxus 0.6

This commit is contained in:
2024-12-12 18:23:02 +01:00
parent f56a85277a
commit a3708198ce
25 changed files with 3193 additions and 960 deletions

View File

@@ -1,21 +1,12 @@
use std::ops::Deref;
use std::str::FromStr;
use std::sync::Mutex;
use chrono::Locale;
use dioxus::fullstack::once_cell::sync::Lazy;
use dioxus_sdk::i18n::Language;
use feruca::Collator;
use unic_langid_impl::LanguageIdentifier;
const EN_US: &str = include_str!("en_us.json");
const CS_CZ: &str = include_str!("cs_cz.json");
pub(crate) static COLLATOR: Lazy<Mutex<Collator>> = Lazy::new(|| Mutex::new(Collator::default()));
pub(crate) fn get_languages() -> Vec<Language> {
Vec::from([EN_US, CS_CZ]).into_iter().map(|texts| Language::from_str(texts).unwrap()).collect()
}
pub(crate) struct LocaleFromLanguageIdentifier<'a>(&'a LanguageIdentifier);
impl<'a> Deref for LocaleFromLanguageIdentifier<'a> {