Struct gettext::ParseOptions

source ·
pub struct ParseOptions { /* private fields */ }
Expand description

ParseOptions allows setting options for parsing MO catalogs.

Examples

use std::fs::File;

extern crate encoding;
use encoding::all::ISO_8859_1;

let file = File::open("french.mo").unwrap();
let catalog = ParseOptions::new().force_encoding(ISO_8859_1).parse(file).unwrap();

Implementations

Returns a new instance of ParseOptions with default options.

Tries to parse the catalog from the given reader using the specified options.

Forces a use of a specific encoding when parsing strings from a catalog. If this option is not enabled, the parser tries to use the encoding specified in the metadata or UTF-8 if metadata is non-existent.

Forces a use of the given plural formula for deciding the proper plural form for a message. If this option is not enabled, the parser uses the default formula (n != 1).

Trait Implementations

Returns the “default value” for a type. 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.