🌐 Normaliza textos y localización a *snake-case*
This commit is contained in:
parent
dcc83692c1
commit
ee7d2db067
15 changed files with 51 additions and 51 deletions
|
|
@ -1,5 +1,5 @@
|
|||
e404-description = Oops! Page Not Found
|
||||
e404-message = The page you are looking for may have been removed, had its name changed, or is temporarily unavailable.
|
||||
e500-description = Oops! Unexpected Error
|
||||
e500-message = We're having an issue. Please report this error to an administrator.
|
||||
back-homepage = Back to homepage
|
||||
e404_description = Oops! Page Not Found
|
||||
e404_message = The page you are looking for may have been removed, had its name changed, or is temporarily unavailable.
|
||||
e500_description = Oops! Unexpected Error
|
||||
e500_message = We're having an issue. Please report this error to an administrator.
|
||||
back_homepage = Back to homepage
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
header = Header
|
||||
nav_branding = Navigation branding region
|
||||
nav_main = Main navigation region
|
||||
nav_additional = Additional navigation region (eg search form, social icons, etc)
|
||||
breadcrumb = Breadcrumb
|
||||
content = Main content
|
||||
sidebar_first = Sidebar first
|
||||
sidebar_second = Sidebar second
|
||||
footer = Footer
|
||||
region_header = Header
|
||||
region_nav_branding = Navigation branding region
|
||||
region_nav_main = Main navigation region
|
||||
region_nav_additional = Additional navigation region (eg search form, social icons, etc)
|
||||
region_breadcrumb = Breadcrumb
|
||||
region_content = Main content
|
||||
region_sidebar_first = Sidebar first
|
||||
region_sidebar_second = Sidebar second
|
||||
region_footer = Footer
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
e404-description = ¡Vaya! Página No Encontrada
|
||||
e404-message = La página que está buscando puede haber sido eliminada, cambiada de nombre o no está disponible temporalmente.
|
||||
e500-description = ¡Vaya! Error Inesperado
|
||||
e500-message = Está ocurriendo una incidencia. Por favor, informe de este error a un administrador.
|
||||
back-homepage = Volver al inicio
|
||||
e404_description = ¡Vaya! Página No Encontrada
|
||||
e404_message = La página que está buscando puede haber sido eliminada, cambiada de nombre o no está disponible temporalmente.
|
||||
e500_description = ¡Vaya! Error Inesperado
|
||||
e500_message = Está ocurriendo una incidencia. Por favor, informe de este error a un administrador.
|
||||
back_homepage = Volver al inicio
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
header = Cabecera
|
||||
nav_branding = Navegación y marca
|
||||
nav_main = Navegación principal
|
||||
nav_additional = Navegación adicional (p.e. formulario de búsqueda, iconos sociales, etc.)
|
||||
breadcrumb = Ruta de posicionamiento
|
||||
content = Contenido principal
|
||||
sidebar_first = Barra lateral primera
|
||||
sidebar_second = Barra lateral segunda
|
||||
footer = Pie
|
||||
region_header = Cabecera
|
||||
region_nav_branding = Navegación y marca
|
||||
region_nav_main = Navegación principal
|
||||
region_nav_additional = Navegación adicional (p.e. formulario de búsqueda, iconos sociales, etc.)
|
||||
region_breadcrumb = Ruta de posicionamiento
|
||||
region_content = Contenido principal
|
||||
region_sidebar_first = Barra lateral primera
|
||||
region_sidebar_second = Barra lateral segunda
|
||||
region_footer = Pie
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ impl Image {
|
|||
self
|
||||
}
|
||||
|
||||
/// Define el texto alternativo localizado ([`L10n`]) para la imagen.
|
||||
/// Define un *texto localizado* ([`L10n`]) alternativo para la imagen.
|
||||
///
|
||||
/// Se recomienda siempre aportar un texto alternativo salvo que la imagen sea puramente
|
||||
/// decorativa.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
//!
|
||||
//! Cada [`navbar::Item`](crate::theme::navbar::Item) representa un elemento individual de la barra
|
||||
//! de navegación [`Navbar`], con distintos comportamientos según su finalidad, como menús
|
||||
//! [`Nav`](crate::theme::Nav) o textos localizados usando [`L10n`](pagetop::locale::L10n).
|
||||
//! [`Nav`](crate::theme::Nav) o *textos localizados* usando [`L10n`](pagetop::locale::L10n).
|
||||
//!
|
||||
//! También puede mostrar una marca de identidad ([`navbar::Brand`](crate::theme::navbar::Brand))
|
||||
//! que identifique la compañía, producto o nombre del proyecto asociado a la solución web.
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ pub enum Item {
|
|||
Brand(Typed<navbar::Brand>),
|
||||
/// Representa un menú de navegación [`Nav`](crate::theme::Nav).
|
||||
Nav(Typed<Nav>),
|
||||
/// Representa un texto libre localizado.
|
||||
/// Representa un *texto localizado* libre.
|
||||
Text(L10n),
|
||||
}
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ impl Item {
|
|||
Self::Nav(Typed::with(item))
|
||||
}
|
||||
|
||||
/// Crea un elemento de texto localizado, mostrado sin interacción.
|
||||
/// Crea un elemento con un *texto localizado*, mostrado sin interacción.
|
||||
pub fn text(item: L10n) -> Self {
|
||||
Self::Text(item)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ use crate::{actions_boxed, service};
|
|||
/// }
|
||||
/// ```
|
||||
pub trait Extension: AnyInfo + Send + Sync {
|
||||
/// Nombre localizado de la extensión legible para el usuario.
|
||||
/// Nombre de la extensión como *texto localizado* legible para el usuario.
|
||||
///
|
||||
/// Predeterminado por el [`short_name()`](AnyInfo::short_name) del tipo asociado a la
|
||||
/// extensión.
|
||||
|
|
@ -32,7 +32,7 @@ pub trait Extension: AnyInfo + Send + Sync {
|
|||
L10n::n(self.short_name())
|
||||
}
|
||||
|
||||
/// Descripción corta localizada de la extensión para paneles, listados, etc.
|
||||
/// Descripción corta de la extensión como *texto localizado* para paneles, listados, etc.
|
||||
///
|
||||
/// Por defecto devuelve un valor vacío (`L10n::default()`).
|
||||
fn description(&self) -> L10n {
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ pub trait Region {
|
|||
/// las clases del contenedor de la región (`"region region-<name>"`).
|
||||
fn name(&self) -> &'static str;
|
||||
|
||||
/// Devuelve la etiqueta de accesibilidad localizada asociada a la región.
|
||||
/// Devuelve un *texto localizado* como etiqueta de accesibilidad asociada a la región.
|
||||
///
|
||||
/// En la implementación predeterminada de [`Self::render()`], este valor se usa como
|
||||
/// `aria-label` del contenedor de la región.
|
||||
|
|
@ -64,8 +64,8 @@ pub trait Region {
|
|||
/// Renderiza el contenedor de la región.
|
||||
///
|
||||
/// Por defecto, recupera del [`Context`] el contenido de la región y, si no está vacío, lo
|
||||
/// envuelve en un `<div>` con clases `"region region-<name>"` y un `aria-label` basado en la
|
||||
/// etiqueta localizada de la región:
|
||||
/// envuelve en un `<div>` con clases `"region region-<name>"` y un `aria-label` basado en el
|
||||
/// *texto localizado* de la etiqueta asociada a la región:
|
||||
///
|
||||
/// ```html
|
||||
/// <div class="region region-<name>" role="region" aria-label="<label>">
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ pub trait Theme: Extension + Send + Sync {
|
|||
/// Contenido predeterminado para la página de error "*403 - Forbidden*".
|
||||
///
|
||||
/// Los temas pueden sobrescribir este método para personalizar el diseño y el contenido de la
|
||||
/// página de error, manteniendo o no el mensaje de los textos localizados.
|
||||
/// página de error, manteniendo o no el mensaje de los *textos localizados*.
|
||||
fn error403(&self, page: &mut Page) -> Markup {
|
||||
html! { div { h1 { (L10n::l("error403_notice").using(page)) } } }
|
||||
}
|
||||
|
|
@ -166,7 +166,7 @@ pub trait Theme: Extension + Send + Sync {
|
|||
/// Contenido predeterminado para la página de error "*404 - Not Found*".
|
||||
///
|
||||
/// Los temas pueden sobrescribir este método para personalizar el diseño y el contenido de la
|
||||
/// página de error, manteniendo o no el mensaje de los textos localizados.
|
||||
/// página de error, manteniendo o no el mensaje de los *textos localizados*.
|
||||
fn error404(&self, page: &mut Page) -> Markup {
|
||||
html! { div { h1 { (L10n::l("error404_notice").using(page)) } } }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use crate::{builder_fn, AutoDefault};
|
|||
/// ```rust
|
||||
/// # use pagetop::prelude::*;
|
||||
/// // Traducción por clave en las locales por defecto de PageTop.
|
||||
/// let hello = AttrL10n::new(L10n::l("test-hello-world"));
|
||||
/// let hello = AttrL10n::new(L10n::l("test_hello_world"));
|
||||
///
|
||||
/// // Español disponible.
|
||||
/// assert_eq!(
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ enum L10nOp {
|
|||
Translate(Cow<'static, str>),
|
||||
}
|
||||
|
||||
/// Crea instancias para traducir textos localizados.
|
||||
/// Crea instancias para traducir *textos localizados*.
|
||||
///
|
||||
/// Cada instancia puede representar:
|
||||
///
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
test-hello-world = Hello world!
|
||||
test-hello-user = Hello, { $userName }!
|
||||
test-shared-photos =
|
||||
test_hello_world = Hello world!
|
||||
test_hello_user = Hello, { $userName }!
|
||||
test_shared_photos =
|
||||
{ $userName } { $photoCount ->
|
||||
[one] added a new photo
|
||||
*[other] added { $photoCount } new photos
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
test-hello-world = ¡Hola mundo!
|
||||
test-hello-user = ¡Hola, { $userName }!
|
||||
test-shared-photos =
|
||||
test_hello_world = ¡Hola mundo!
|
||||
test_hello_user = ¡Hola, { $userName }!
|
||||
test_shared_photos =
|
||||
{ $userName } { $photoCount ->
|
||||
[one] ha añadido una nueva foto
|
||||
*[other] ha añadido { $photoCount } nuevas fotos
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ async fn literal_text() {
|
|||
async fn translation_without_args() {
|
||||
let _app = service::test::init_service(Application::new().test()).await;
|
||||
|
||||
let l10n = L10n::l("test-hello-world");
|
||||
let l10n = L10n::l("test_hello_world");
|
||||
let translation = l10n.lookup(&LangMatch::resolve("es-ES"));
|
||||
assert_eq!(translation, Some("¡Hola mundo!".to_string()));
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@ async fn translation_without_args() {
|
|||
async fn translation_with_args() {
|
||||
let _app = service::test::init_service(Application::new().test()).await;
|
||||
|
||||
let l10n = L10n::l("test-hello-user").with_arg("userName", "Manuel");
|
||||
let l10n = L10n::l("test_hello_user").with_arg("userName", "Manuel");
|
||||
let translation = l10n.lookup(&LangMatch::resolve("es-ES"));
|
||||
assert_eq!(translation, Some("¡Hola, Manuel!".to_string()));
|
||||
}
|
||||
|
|
@ -30,7 +30,7 @@ async fn translation_with_args() {
|
|||
async fn translation_with_plural_and_select() {
|
||||
let _app = service::test::init_service(Application::new().test()).await;
|
||||
|
||||
let l10n = L10n::l("test-shared-photos").with_args(vec![
|
||||
let l10n = L10n::l("test_shared_photos").with_args(vec![
|
||||
("userName", "Roberto"),
|
||||
("photoCount", "3"),
|
||||
("userGender", "male"),
|
||||
|
|
@ -43,7 +43,7 @@ async fn translation_with_plural_and_select() {
|
|||
async fn check_fallback_language() {
|
||||
let _app = service::test::init_service(Application::new().test()).await;
|
||||
|
||||
let l10n = L10n::l("test-hello-world");
|
||||
let l10n = L10n::l("test_hello_world");
|
||||
let translation = l10n.lookup(&LangMatch::resolve("xx-YY")); // Retrocede a "en-US".
|
||||
assert_eq!(translation, Some("Hello world!".to_string()));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue