Struct gooey::fluent::FluentLocalizer
source · [−]pub struct FluentLocalizer { /* private fields */ }
Expand description
A Localizer
for Gooey that utilizes fluent
.
During construction, FluentLocalizer
gathers a unique list of primary
LanguageIdentifier
s for each of the FluentBundle
s provided. When
localizing, this list is filtered using
fluent-langneg
, and resources
are searched through all matching bundles in the order determined by
fluent-langneg
.
This type supports inserting more than one bundle for a given
LanguageIdentifier
.
Implementations
sourceimpl FluentLocalizer
impl FluentLocalizer
sourcepub fn new(
default_language: LanguageIdentifier,
bundles: Vec<FluentBundle<FluentResource, IntlLangMemoizer>, Global>
) -> FluentLocalizer
pub fn new(
default_language: LanguageIdentifier,
bundles: Vec<FluentBundle<FluentResource, IntlLangMemoizer>, Global>
) -> FluentLocalizer
Creates a new instance that localizes using bundles
.
Trait Implementations
sourceimpl Debug for FluentLocalizer
impl Debug for FluentLocalizer
sourceimpl Localizer for FluentLocalizer
impl Localizer for FluentLocalizer
sourcefn localize(
&self,
key: &str,
parameters: Option<LocalizationParameters<'a>>,
language: &LanguageIdentifier
) -> String
fn localize(
&self,
key: &str,
parameters: Option<LocalizationParameters<'a>>,
language: &LanguageIdentifier
) -> String
Localizes key
with parameters
and returns a string in the user’s
preferred locale. Read more
Auto Trait Implementations
impl !RefUnwindSafe for FluentLocalizer
impl Send for FluentLocalizer
impl Sync for FluentLocalizer
impl Unpin for FluentLocalizer
impl !UnwindSafe for FluentLocalizer
Blanket Implementations
sourceimpl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
sourcefn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified method Read more
sourcefn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford method by default Read more
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T, U> IntoColor<U> for T where
U: FromColor<T>,
impl<T, U> IntoColor<U> for T where
U: FromColor<T>,
sourcefn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
sourceimpl<T, U> IntoColorUnclamped<U> for T where
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for T where
U: FromColorUnclamped<T>,
sourcefn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
sourceimpl<T, U> TryIntoColor<U> for T where
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for T where
U: TryFromColor<T>,
sourcefn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined
range, otherwise an OutOfBounds
error is returned which contains
the unclamped color. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more