🧑💻 Mejora y simplifica localización de módulos
This commit is contained in:
parent
d0add7c7ab
commit
520d3bb20b
21 changed files with 265 additions and 325 deletions
|
|
@ -13,12 +13,12 @@ impl ModuleTrait for Admin {
|
|||
MODULE_ADMIN
|
||||
}
|
||||
|
||||
fn name(&self) -> String {
|
||||
_t("module_name", Locale::From(&LOCALE_ADMIN))
|
||||
fn name(&self) -> L10n {
|
||||
L10n::t("module_name", &LOCALE_ADMIN)
|
||||
}
|
||||
|
||||
fn description(&self) -> Option<String> {
|
||||
Some(_t("module_description", Locale::From(&LOCALE_ADMIN)))
|
||||
fn description(&self) -> L10n {
|
||||
L10n::t("module_description", &LOCALE_ADMIN)
|
||||
}
|
||||
|
||||
#[rustfmt::skip]
|
||||
|
|
|
|||
|
|
@ -5,64 +5,64 @@ use pagetop_minimal::component::*;
|
|||
|
||||
pub async fn summary(request: server::HttpRequest) -> ResultPage<Markup, FatalError> {
|
||||
let top_menu = MegaMenu::new()
|
||||
.with_item(MegaMenuItem::label(Text::t("module_name", &LOCALE_ADMIN)))
|
||||
.with_item(MegaMenuItem::label(L10n::t("module_name", &LOCALE_ADMIN)))
|
||||
.with_item(MegaMenuItem::link(
|
||||
Text::n("Opción 2"),
|
||||
L10n::text("Opción 2"),
|
||||
"https://www.google.es",
|
||||
))
|
||||
.with_item(MegaMenuItem::link_blank(
|
||||
Text::n("Opción 3"),
|
||||
L10n::text("Opción 3"),
|
||||
"https://www.google.es",
|
||||
))
|
||||
.with_item(MegaMenuItem::submenu(
|
||||
Text::n("Submenú 1"),
|
||||
L10n::text("Submenú 1"),
|
||||
MegaMenu::new()
|
||||
.with_item(MegaMenuItem::label(Text::n("Opción 1")))
|
||||
.with_item(MegaMenuItem::label(Text::n("Opción 2"))),
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 1")))
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 2"))),
|
||||
))
|
||||
.with_item(MegaMenuItem::separator())
|
||||
.with_item(MegaMenuItem::submenu(
|
||||
Text::n("Submenú 2"),
|
||||
L10n::text("Submenú 2"),
|
||||
MegaMenu::new()
|
||||
.with_item(MegaMenuItem::label(Text::n("Opción 1")))
|
||||
.with_item(MegaMenuItem::label(Text::n("Opción 2"))),
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 1")))
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 2"))),
|
||||
))
|
||||
.with_item(MegaMenuItem::label(Text::n("Opción 4")));
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 4")));
|
||||
|
||||
let side_menu = MegaMenu::new()
|
||||
.with_item(MegaMenuItem::label(Text::n("Opción 1")))
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 1")))
|
||||
.with_item(MegaMenuItem::link(
|
||||
Text::n("Opción 2"),
|
||||
L10n::text("Opción 2"),
|
||||
"https://www.google.es",
|
||||
))
|
||||
.with_item(MegaMenuItem::link_blank(
|
||||
Text::n("Opción 3"),
|
||||
L10n::text("Opción 3"),
|
||||
"https://www.google.es",
|
||||
))
|
||||
.with_item(MegaMenuItem::submenu(
|
||||
Text::n("Submenú 1"),
|
||||
L10n::text("Submenú 1"),
|
||||
MegaMenu::new()
|
||||
.with_item(MegaMenuItem::label(Text::n("Opción 1")))
|
||||
.with_item(MegaMenuItem::label(Text::n("Opción 2"))),
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 1")))
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 2"))),
|
||||
))
|
||||
.with_item(MegaMenuItem::separator())
|
||||
.with_item(MegaMenuItem::submenu(
|
||||
Text::n("Submenú 2"),
|
||||
L10n::text("Submenú 2"),
|
||||
MegaMenu::new()
|
||||
.with_item(MegaMenuItem::label(Text::n("Opción 1")))
|
||||
.with_item(MegaMenuItem::label(Text::n("Opción 2"))),
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 1")))
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 2"))),
|
||||
))
|
||||
.with_item(MegaMenuItem::label(Text::n("Opción 4")));
|
||||
.with_item(MegaMenuItem::label(L10n::text("Opción 4")));
|
||||
|
||||
Page::new(request)
|
||||
.with_context(ContextOp::Theme("Bootsier"))
|
||||
.with_title(Text::n("Admin"))
|
||||
.with_title(L10n::text("Admin"))
|
||||
.with_this_in("top-menu", top_menu)
|
||||
.with_this_in(
|
||||
"region-content",
|
||||
grid::Row::new()
|
||||
.with_column(grid::Column::new().with_component(side_menu))
|
||||
.with_column(grid::Column::new().with_component(Html::n(html! {
|
||||
.with_column(grid::Column::new().with_component(L10n::html(html! {
|
||||
p { "Columna 2"}
|
||||
}))),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue