🚚 Rename Translate component to Fluent
This commit is contained in:
parent
d80a594cf5
commit
57e71a9399
2 changed files with 9 additions and 9 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue