Put the lang in front of url (WIP)
This commit is contained in:
parent
418d31a127
commit
b39cb1c067
4 changed files with 8 additions and 6 deletions
|
|
@ -7,7 +7,7 @@ use crate::{
|
|||
calendar,
|
||||
recipe_scheduler::RecipeScheduler,
|
||||
shopping_list::ShoppingList,
|
||||
utils::{SelectorExt, by_id, get_locale, selector},
|
||||
utils::{SelectorExt, by_id, get_current_lang, get_locale, selector},
|
||||
};
|
||||
|
||||
pub fn setup_page(is_user_logged: bool) {
|
||||
|
|
@ -25,6 +25,8 @@ pub fn setup_page(is_user_logged: bool) {
|
|||
let shopping_list = ShoppingList::new(!is_user_logged);
|
||||
|
||||
spawn_local(async move {
|
||||
let lang = get_current_lang();
|
||||
let local = get_locale();
|
||||
let item_template: Element = selector("#hidden-templates .shopping-item");
|
||||
let container: Element = by_id("shopping-list");
|
||||
let container_checked: Element = by_id("shopping-list-checked");
|
||||
|
|
@ -53,10 +55,10 @@ pub fn setup_page(is_user_logged: bool) {
|
|||
recipe_element.set_inner_html(&format!(
|
||||
"{} @ {}",
|
||||
recipe_title,
|
||||
date.format_localized(&date_format, get_locale()),
|
||||
date.format_localized(&date_format, local),
|
||||
));
|
||||
recipe_element
|
||||
.set_attribute("href", &format!("/recipe/view/{}", recipe_id))
|
||||
.set_attribute("href", &format!("/{}/recipe/view/{}", lang, recipe_id))
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue