🎨 Nueov enfoque para las funciones de traducción
This commit is contained in:
parent
7691bf4b2f
commit
71b0b0889d
11 changed files with 110 additions and 93 deletions
|
|
@ -2,7 +2,7 @@ use pagetop::prelude::*;
|
|||
|
||||
define_handle!(MODULE_ADMIN);
|
||||
|
||||
define_locale!("src/locales");
|
||||
define_locale!(LOCALE_ADMIN, "src/locales");
|
||||
|
||||
mod summary;
|
||||
|
||||
|
|
@ -14,11 +14,11 @@ impl ModuleTrait for Admin {
|
|||
}
|
||||
|
||||
fn name(&self) -> String {
|
||||
l("module_name")
|
||||
t("module_name", Locale::From(&LOCALE_ADMIN))
|
||||
}
|
||||
|
||||
fn description(&self) -> Option<String> {
|
||||
Some(l("module_description"))
|
||||
Some(t("module_description", Locale::From(&LOCALE_ADMIN)))
|
||||
}
|
||||
|
||||
#[rustfmt::skip]
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
use super::l;
|
||||
use super::LOCALE_ADMIN;
|
||||
use pagetop::prelude::*;
|
||||
use pagetop_megamenu::component::{MegaMenu, MegaMenuItem};
|
||||
use pagetop_minimal::component::*;
|
||||
|
||||
pub async fn summary(request: server::HttpRequest) -> ResultPage<Markup, FatalError> {
|
||||
let top_menu = MegaMenu::new()
|
||||
.with_item(MegaMenuItem::label(l("module_name").as_str()))
|
||||
.with_item(MegaMenuItem::label(
|
||||
t("module_name", Locale::From(&LOCALE_ADMIN)).as_str(),
|
||||
))
|
||||
.with_item(MegaMenuItem::link("Opción 2", "https://www.google.es"))
|
||||
.with_item(MegaMenuItem::link_blank(
|
||||
"Opción 3",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue