♻️ (locale): Renombra L10n a Lc

Simplifica el nombre del tipo de localización. Actualiza todas las
referencias en el crate principal, extensiones, ejemplos y tests.
This commit is contained in:
Manuel Cillero 2026-08-12 22:56:09 +02:00
parent 3198b74399
commit be10dd28a1
65 changed files with 612 additions and 621 deletions

View file

@ -27,7 +27,7 @@ use crate::core::theme::{CoreRegions, RegionName, RegionRef, TemplateRef, ThemeR
use crate::html::{Assets, Favicon, JavaScript, StyleSheet};
use crate::html::{Attr, Props, PropsOp};
use crate::html::{DOCTYPE, Markup, html};
use crate::locale::{CharacterDirection, L10n, LangId, LanguageIdentifier};
use crate::locale::{CharacterDirection, LangId, LanguageIdentifier, Lc};
use crate::web::HttpRequest;
use crate::{AutoDefault, builder_fn};
@ -73,8 +73,8 @@ impl RegionName for ReservedRegions {
}
#[inline]
fn label(&self) -> L10n {
L10n::default()
fn label(&self) -> Lc {
Lc::default()
}
}
@ -88,8 +88,8 @@ impl RegionName for ReservedRegions {
#[rustfmt::skip]
#[derive(AutoDefault)]
pub struct Page {
title : Attr<L10n>,
description : Attr<L10n>,
title : Attr<Lc>,
description : Attr<Lc>,
metadata : Vec<(&'static str, &'static str)>,
properties : Vec<(&'static str, &'static str)>,
context : Context,
@ -127,14 +127,14 @@ impl Page {
/// Establece el título de la página como un valor traducible.
#[builder_fn]
pub fn with_title(mut self, title: L10n) -> Self {
pub fn with_title(mut self, title: Lc) -> Self {
self.title.alter_value(title);
self
}
/// Establece la descripción de la página como un valor traducible.
#[builder_fn]
pub fn with_description(mut self, description: L10n) -> Self {
pub fn with_description(mut self, description: Lc) -> Self {
self.description.alter_value(description);
self
}
@ -258,8 +258,8 @@ impl Page {
/// Permite a [`Page`] actuar como proveedor de idioma usando el [`Context`] de la página.
///
/// Resulta útil para usar [`Page`] directamente como fuente de traducción en [`L10n::lookup()`] o
/// [`L10n::using()`].
/// Resulta útil para usar [`Page`] directamente como fuente de traducción en [`Lc::lookup()`] o
/// [`Lc::using()`].
impl LangId for Page {
#[inline]
fn langid(&self) -> &'static LanguageIdentifier {

View file

@ -3,7 +3,7 @@ use axum::middleware::Next;
use crate::core::component::Contextual;
use crate::html::Markup;
use crate::locale::L10n;
use crate::locale::Lc;
use crate::web::{HttpRequest, IntoResponse, Response, http};
use crate::{trace, util};
@ -89,9 +89,9 @@ impl ErrorPage {
page.theme().error_fatal(
&mut page,
status,
L10n::l(util::join!("error", status.as_str(), "_title")),
L10n::l(util::join!("error", status.as_str(), "_alert")),
L10n::l(util::join!("error", status.as_str(), "_help")),
Lc::l(util::join!("error", status.as_str(), "_title")),
Lc::l(util::join!("error", status.as_str(), "_alert")),
Lc::l(util::join!("error", status.as_str(), "_help")),
);
page
}