Implemented public part and creating reservations.
This commit is contained in:
@@ -44,6 +44,18 @@ lazy_static! {
|
||||
("Price", "Cena"),
|
||||
("Edit hours", "Upravit hodiny"),
|
||||
("Hours", "Hodiny"),
|
||||
("Who is booking", "Kdo rezervuje"),
|
||||
("Reservation", "Rezervace"),
|
||||
("Booking", "Rezervace"),
|
||||
("Enter full name", "Zdejte celé jméno"),
|
||||
("Enter e-mail address", "Zadejte e-mailovou adresu"),
|
||||
("Phone number", "Telefonní číslo"),
|
||||
("Enter phone number", "Zadejte telefonní číslo"),
|
||||
("Book", "Rezervovat"),
|
||||
("Total price of booking", "Celková cena rezervace"),
|
||||
("Date", "Datum"),
|
||||
("Note", "Poznámka"),
|
||||
("Enter note", "Zadejte poznámku"),
|
||||
])),
|
||||
("sk", HashMap::from( [
|
||||
("Dashboard", "Prehlad"),
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
use chrono::NaiveDate;
|
||||
use leptos::use_context;
|
||||
use crate::locales::catalogues::get_dictionary;
|
||||
|
||||
mod catalogues;
|
||||
@@ -32,4 +34,21 @@ pub fn trl(phrase: &str) -> impl Fn() -> String {
|
||||
let out = translated.to_string();
|
||||
|
||||
move || { out.clone() }
|
||||
}
|
||||
|
||||
// ToDo better date formatting
|
||||
pub fn loc_date(date: NaiveDate) -> impl Fn() -> String {
|
||||
let mut dt = date.format("%Y-%m-%d").to_string();
|
||||
let locs = use_context::<Locales>().unwrap_or(Locales(vec![])).0;
|
||||
for loc in locs {
|
||||
if let Some(key) = loc {
|
||||
if let Some(k) = key.split("-").collect::<Vec<_>>().get(0) {
|
||||
if *k != "en" {
|
||||
dt = date.format("%d. %m. %Y").to_string();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
move || { dt.clone() }
|
||||
}
|
||||
Reference in New Issue
Block a user