pub struct Translator(/* private fields */);Expand description
A thread-owned formatter with no cross-thread locks during formatting.
Construct one from a shared Catalog on each thread that needs translations.
Implementations§
Source§impl Translator
impl Translator
Sourcepub fn formatting_locale(&self) -> &Locale
pub fn formatting_locale(&self) -> &Locale
The requested regional locale that selected this catalog language.
Data formatting retains region preferences such as en-GB even when UI
messages come from the more general en catalog.
Sourcepub fn locale(&self) -> &Locale
pub fn locale(&self) -> &Locale
The first selected catalog language and the requested preview settings. Layout direction follows this effective language, including on fallback.
Sourcepub fn with_fallback(&self, library: &Catalog) -> Self
pub fn with_fallback(&self, library: &Catalog) -> Self
Adds library translations while retaining the original language preferences.
Trait Implementations§
Source§impl Clone for Translator
impl Clone for Translator
Auto Trait Implementations§
impl !RefUnwindSafe for Translator
impl !Send for Translator
impl !Sync for Translator
impl !UnwindSafe for Translator
impl Freeze for Translator
impl Unpin for Translator
impl UnsafeUnpin for Translator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more