[][src]Struct druid::localization::L10nManager

pub struct L10nManager { /* fields omitted */ }

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]

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

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> RoundFrom<T> for T

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>,