Struct i18n_config::GettextConfig[][src]

pub struct GettextConfig {
    pub target_languages: Vec<String>,
    pub output_dir: PathBuf,
    pub extract_to_parent: bool,
    pub collate_extracted_subcrates: bool,
    pub copyright_holder: Option<String>,
    pub msgid_bugs_address: Option<String>,
    pub xtr: Option<bool>,
    pub add_location: GettextAddLocation,
    pub use_fuzzy: bool,
    // some fields omitted
}

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

Fields

target_languages: Vec<String>

The languages that the software will be translated into.

output_dir: PathBuf

Path to the output directory, relative to i18n.toml of the crate being localized.

extract_to_parent: boolcollate_extracted_subcrates: boolcopyright_holder: Option<String>

Set the copyright holder for the generated files.

msgid_bugs_address: Option<String>

The reporting address for msgid bugs. This is the email address or URL to which the translators shall report bugs in the untranslated strings.

xtr: Option<bool>

Whether or not to perform string extraction using the xtr command.

add_location: GettextAddLocation

Generate ‘#: filename:line’ lines (default) in the pot files when running the xtr command. If the type is ‘full’ (the default), it generates the lines with both file name and line number. If it is ‘file’, the line number part is omitted. If it is ‘never’, nothing is generated. [possible values: full, file, never].

use_fuzzy: bool

Enable the --use-fuzzy option for the msgfmt command.

By default this is false.

Implementations

impl GettextConfig[src]

pub fn pot_dir(&self) -> PathBuf[src]

Path to where the pot files will be written to by the xtr command, and were they will be read from by msginit and msgmerge.

By default this is output_dir/pot.

pub fn po_dir(&self) -> PathBuf[src]

Path to where the po files will be stored/edited with the msgmerge and msginit commands, and where they will be read from with the msgfmt command.

By default this is output_dir/po.

pub fn mo_dir(&self) -> PathBuf[src]

Path to where the mo files will be written to by the msgfmt command.

By default this is output_dir/mo.

Trait Implementations

impl Clone for GettextConfig[src]

impl Debug for GettextConfig[src]

impl<'de> Deserialize<'de> for GettextConfig[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.