[−][src]Struct druid::localization::L10nManager
Provides access to the localization strings for the current locale.
Methods
impl L10nManager
[src]
pub fn new(resources: Vec<String>, base_dir: &str) -> Self
[src]
Create a new localization manager.
resources
is a list of file names that contain strings. base_dir
is a path to a directory that includes per-locale subdirectories.
This directory should be of the structure base_dir/{locale}/{resource}
,
where '{locale}' is a valid BCP47 language tag, and {resource} is a .ftl
included in resources
.
pub fn localize<'args>(
&'args self,
key: &str,
args: impl Into<Option<&'args FluentArgs<'args>>>
) -> Option<String>
[src]
&'args self,
key: &str,
args: impl Into<Option<&'args FluentArgs<'args>>>
) -> Option<String>
Fetch a localized string from the current bundle by key.
In general, this should not be used directly; LocalizedString
should be used for localization, and you should call
LocalizedString::resolve
to update the string as required.
Auto Trait Implementations
impl Send for L10nManager
impl Sync for L10nManager
impl Unpin for L10nManager
impl !UnwindSafe for L10nManager
impl !RefUnwindSafe for L10nManager
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> RoundFrom<T> for T
fn round_from(x: T) -> T
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
U: RoundFrom<T>,