* Support for lang in URL as /fr/recipe/view/42
* Create a pages module in the frontend crate
This commit is contained in:
parent
b812525f4b
commit
418d31a127
12 changed files with 117 additions and 80 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue