[][src]Struct i18n_config::I18nConfig

pub struct I18nConfig {
    pub src_locale: String,
    pub target_locales: Vec<String>,
    pub subcrates: Vec<PathBuf>,
    pub gettext: Option<GettextConfig>,
}

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

Fields

src_locale: String

The locale/language identifier of the language used in the source code.

target_locales: Vec<String>

The locales that the software will be translated into.

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.

Methods

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.