pub struct Translator<'a> { /* private fields */ }Expand description
Messages in one language.
Implementations§
Source§impl Translator<'_>
impl Translator<'_>
Sourcepub fn t(&self, key: &str) -> String
pub fn t(&self, key: &str) -> String
The message for key; the key itself when no catalog has it.
Sourcepub fn t_with(&self, key: &str, args: &[(&str, &str)]) -> String
pub fn t_with(&self, key: &str, args: &[(&str, &str)]) -> String
The message for key with {name} placeholders filled from args
({{ and }} are literal braces; unknown names stay as written).
Sourcepub fn plural(&self, key: &str, count: u64) -> String
pub fn plural(&self, key: &str, count: u64) -> String
key.<category> for count in this language (one, few, many,
other; see plural_category), falling back to key.other, with
{count} and args filled in.
Sourcepub fn plural_with(
&self,
key: &str,
count: u64,
args: &[(&str, &str)],
) -> String
pub fn plural_with( &self, key: &str, count: u64, args: &[(&str, &str)], ) -> String
Translator::plural with more placeholders.
Trait Implementations§
Source§impl<'a> Clone for Translator<'a>
impl<'a> Clone for Translator<'a>
Auto Trait Implementations§
impl<'a> Freeze for Translator<'a>
impl<'a> RefUnwindSafe for Translator<'a>
impl<'a> Send for Translator<'a>
impl<'a> Sync for Translator<'a>
impl<'a> Unpin for Translator<'a>
impl<'a> UnsafeUnpin for Translator<'a>
impl<'a> UnwindSafe for Translator<'a>
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