pub struct Localizer { /* private fields */ }Expand description
Implementations§
Source§impl Localizer
impl Localizer
Sourcepub fn builtin(locale: &str) -> Self
pub fn builtin(locale: &str) -> Self
The built-in dictionaries for en, es, fr, de, pt, and ar; any other
locale gets English.
Sourcepub fn load(
directory: impl AsRef<Path>,
locale: &str,
) -> Result<Self, LocalizationError>
Available on crate feature threads only.
pub fn load( directory: impl AsRef<Path>, locale: &str, ) -> Result<Self, LocalizationError>
threads only.Load <locale>.ftl from a directory, falling back to the built-ins.
§Errors
When the file exists but cannot be read.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Localizer
impl Freeze for Localizer
impl Move for Localizer
impl RefUnwindSafe for Localizer
impl Send for Localizer
impl Sync for Localizer
impl Unpin for Localizer
impl UnsafeUnpin for Localizerwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
impl UnwindSafe for Localizer
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more