🚚 Rename Translate component to Fluent

This commit is contained in:
Manuel Cillero 2024-03-07 21:18:57 +01:00
parent d80a594cf5
commit 57e71a9399
2 changed files with 9 additions and 9 deletions

View file

@ -1,34 +0,0 @@
use crate::prelude::*;
#[derive(AutoDefault)]
pub struct Translate(L10n);
impl ComponentTrait for Translate {
fn new() -> Self {
Translate::default()
}
fn prepare_component(&self, cx: &mut Context) -> PrepareMarkup {
PrepareMarkup::With(self.l10n().escaped(cx.langid()))
}
}
impl Translate {
pub fn with(l10n: L10n) -> Self {
Translate(l10n)
}
// Translate BUILDER.
#[fn_builder]
pub fn alter_l10n(&mut self, l10n: L10n) -> &mut Self {
self.0 = l10n;
self
}
// Translate GETTERS.
pub fn l10n(&self) -> &L10n {
&self.0
}
}