pub struct ClientTranslationsManager { /* private fields */ }
Expand description

Manages translations in the app shell. This handles fetching translations from the server as well as caching for performance. This is distinct from TranslationsManager in that it operates on the client-side rather than on the server. This optimizes for users viewing many pages in the same locale, which is by far the most common use of most websites in terms of i18n.

Implementations

Creates a new client-side translations manager that hasn’t cached anything yet. This needs to know about an app’s supported locales so it can avoid network requests to unsupported locales.

Gets an &'static Translator for the given locale. This will use the internally cached Translator if possible, and will otherwise fetch the translations from the server. This needs mutability because it will modify its internal cache if necessary.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.