* Support for lang in URL as /fr/recipe/view/42

* Create a pages module in the frontend crate
This commit is contained in:
Greg Burri 2025-03-26 01:49:02 +01:00
parent b812525f4b
commit 418d31a127
12 changed files with 117 additions and 80 deletions

View file

@ -99,6 +99,16 @@ where
.unwrap()
}
pub fn get_current_lang() -> String {
selector::<Element>("html")
.get_attribute("lang")
.unwrap()
.split("-")
.next()
.unwrap()
.to_string()
}
pub fn get_locale() -> Locale {
let lang_and_territory = selector::<Element>("html")
.get_attribute("lang")