Added settings for company info. Added code for entity validation.

This commit is contained in:
2023-09-08 11:53:08 +02:00
parent 44b8b21426
commit 9dd0993204
18 changed files with 488 additions and 20 deletions
+3 -1
View File
@@ -10,7 +10,9 @@ lazy_static! {
("Settings", "Nastavení"),
("Search...", "Najít..."),
("Close", "Zavřít"),
("Save changes", "Uložit změny")
("Save changes", "Uložit změny"),
("Company info", "Organizace"),
("Name cannot be empty", "Jméno nesmí být prázdné"),
])),
("sk", HashMap::from( [
("Dashboard", "Prehlad"),
+7 -3
View File
@@ -1,15 +1,19 @@
use std::borrow::Cow;
use std::ops::Deref;
use leptos::*;
use crate::locales::catalogues::get_dictionary;
mod catalogues;
pub fn trl(cx: Scope, phrase: &'static str) -> impl Fn() -> &'static str {
pub fn trl(cx: Scope, phrase: &str) -> impl Fn() -> String {
let mut translated = phrase;
if let Some(dict) = get_dictionary(cx) {
if let Some(p) = dict.get(phrase) {
if let Some(p) = dict.get(phrase.to_string().as_str()) {
translated = *p;
}
}
|| { translated }
let out = translated.to_string();
move || { out.clone() }
}