Added settings for company info. Added code for entity validation.
This commit is contained in:
@@ -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
@@ -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() }
|
||||
}
|
||||
Reference in New Issue
Block a user