Struct i18n_config::I18nConfig[][src]

pub struct I18nConfig {
    pub fallback_language: LanguageIdentifier,
    pub subcrates: Vec<PathBuf>,
    pub gettext: Option<GettextConfig>,
    pub fluent: Option<FluentConfig>,
}

The data structure representing what is stored (and possible to store) within a i18n.toml file.

Fields

fallback_language: LanguageIdentifier

The locale identifier of the language used in the source code for gettext system, and the primary fallback language (for which all strings must be present) when using the fluent system.

subcrates: Vec<PathBuf>

Specify which subcrates to perform localization within. The subcrate needs to have its own i18n.toml.

gettext: Option<GettextConfig>

The subcomponent of this config relating to gettext, only present if the gettext localization system will be used.

fluent: Option<FluentConfig>

The subcomponent of this config relating to gettext, only present if the fluent localization system will be used.

Implementations

impl I18nConfig[src]

pub fn from_file<P: AsRef<Path>>(
    toml_path: P
) -> Result<I18nConfig, I18nConfigError>
[src]

Load the config from the specified toml file path.

Trait Implementations

impl Clone for I18nConfig[src]

impl Debug for I18nConfig[src]

impl<'de> Deserialize<'de> for I18nConfig[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.