🚚 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

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