gd_gettext¶
GNU gettext message catalogs: reading and writing PO/POT text, reading and writing compiled MO files (both byte orders), Plural-Forms expressions, msgmerge-style updates with fuzzy matching, and translation statistics.
State is explicit: a Catalog or a Translator instead of the C library’s process-wide domain table. Nothing panics on bad input; every failure is an Error whose Display is an Elm-style report with a hint.
use gd_gettext::Lookup;
let cat = gd_gettext::parse_po("msgid \"Hello\"\nmsgstr \"Hallo\"\n", "de.po")?;
assert_eq!(cat.text("Hello"), "Hallo");
assert_eq!(cat.plural("%d file", "%d files", 3), "%d files");
Reading, merging, and writing cost what the input is long, never its square: a PO field continued over many lines is gathered once; an MO file whose strings share bytes is refused as damaged; the fuzzy search is bounded by FUZZY_WORK_PER_BYTE; and wrapping a long line looks only at the next piece.
Structs
- pub struct gd_gettext::Catalog¶
-
One message catalog: a PO, POT, or MO file’s messages.
The catalog owns everything it holds. Lookups (the
crate::Lookuptrait) use an index built on first use;Catalog::add_message,Catalog::set_header_fieldandcrate::sort_by_referencedrop it. After editingmessagesorheaderdirectly, callCatalog::build_indexbefore the next lookup.Fields
- pub plural: PluralRule¶
-
The compiled Plural-Forms rule;
n != 1without a header.
- pub allow_fuzzy: bool¶
-
Look fuzzy translations up too (Sphinx’s
gettext_allow_fuzzy_translations).
Implementations
- impl Catalog
-
- pub fn new(name: &str) -> Catalog¶
-
Returns an empty catalog named
namewith the germanic plural rule (n != 1).
- pub fn add_message(&mut self, m: Message) -> &mut Message¶
-
Appends a message, which the catalog owns from now on, and returns a reference to it. The lookup index is rebuilt on the next lookup.
- pub fn message_count(&self) -> usize¶
-
Returns the number of messages, obsolete ones included, without the header.
- pub fn header_field(&self, name: &str) -> Option<&str>¶
-
Returns the value of a header field (
"Name: value"line), compared case-insensitively, borrowed from the header.
- pub fn set_header_field(&mut self, name: &str, value: &str)¶
-
Replaces a header field, or appends it, keeping the others in order. Setting
Plural-Formsto a valid rule also replacesCatalog::plural.
- pub fn charset(&self) -> &str¶
-
Returns the charset the header’s Content-Type names, or
""without one.
- impl Catalog
-
- pub fn build_index(&mut self)¶
-
(Re)builds the lookup index now, so the first lookup does not pay for it. Call it after editing
messagesorheaderdirectly.
- pub fn pool(&self) -> &str¶
-
Returns the text every translation of the catalog is a slice of, so a caller can register it once as a source and give parsed translations exact spans.
Trait Implementations
- pub struct gd_gettext::Message¶
-
One catalog entry.
strsholds the msgstr, or msgstr[0..n) of a plural message; an empty string is an untranslated form.Fields
- pub fuzzy: bool¶
-
The
fuzzyflag.
- pub obsolete: bool¶
-
#~: kept for reuse, never looked up.
- pub line: usize¶
-
The 1-based line the entry starts on in its file; 0 when built in code.
Implementations
- impl Message
-
- pub fn new(id: &str) -> Message¶
-
Returns a message with this msgid and one empty (untranslated) msgstr.
- pub fn is_translated(&self) -> bool¶
-
Tells whether every form has a translation (and there is at least one).
- pub fn is_header(&self) -> bool¶
-
Tells whether this is the header entry: msgid 「」 without a context, not obsolete.
- pub fn is_plural(&self) -> bool¶
-
Tells whether the message has a msgid_plural.
- pub fn has_flag(&self, flag: &str) -> bool¶
-
Tells whether the message carries a
#,flag;"fuzzy"isMessage::fuzzy.
- pub struct gd_gettext::Previous¶
-
A fuzzy message’s earlier msgctxt, msgid, and msgid_plural (the
#|comments msgmerge writes), so a translator sees what changed.Fields
- pub struct gd_gettext::Error¶
-
A problem explained the way Elm’s compiler explains one: where, what, and what to do.
The error owns its strings, so it outlives the input it was made from.
Displayrenders the report:-- PO SYNTAX ERROR ------------------------------------------------------ de.po:2 This string has no closing quote. 2| msgstr "b ^ Hint: End the string with " on the same line; continue on the next line with ...Fields
- pub line: usize¶
-
The 1-based line of the problem; 0 when it has no line.
- pub column: usize¶
-
The 1-based byte column of the problem in
excerpt; 0 for none.
Implementations
Trait Implementations
- impl fmt::Display for Error
-
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
- impl std::error::Error for Error
- pub struct gd_gettext::LoadOptions¶
-
How catalogs are loaded. Fill it with struct-update syntax:
LoadOptions { allow_fuzzy: true, ..LoadOptions::default() }.Fields
- pub max_bytes: u64¶
-
The largest file accepted, in bytes; 1 GiB by default. A larger file is refused with an error of kind
ErrorKind::TooLargebefore anything is read.
- pub allow_fuzzy: bool¶
-
Look fuzzy translations up too (Sphinx’s
gettext_allow_fuzzy_translations).
Trait Implementations
- impl Default for LoadOptions
-
- fn default() -> LoadOptions
- pub struct gd_gettext::Forms<'a>¶
-
The translated forms of one message, borrowed from the catalog that found them.
An editable
crate::Catalogkeeps each form apart in its pool; a zero-copycrate::MoCatalogkeeps them as the MO file does, joined by NUL. Both look the same from here.Implementations
- impl<'a> Forms<'a>
-
- pub fn len(&self) -> usize¶
-
Returns the number of forms.
- pub fn is_empty(&self) -> bool¶
-
Tells whether there are no forms.
- pub fn get(&self, k: usize) -> Option<&'a str>¶
-
Returns form
k(0 is the singular), borrowed from the catalog, if it exists.
- pub fn iter(&self) -> impl Iterator<Item = &'a str> + 'a¶
-
Iterates the forms in order.
- pub struct gd_gettext::MergeOptions¶
-
How
mergeworks. The default is msgmerge’s: fuzzy matching on, obsolete messages kept.Fields
- pub fuzzy_matching: bool¶
-
Look for similar messages (msgmerge without
-N).
- pub keep_obsolete: bool¶
-
Keep translated messages that left the template as
#~.
Trait Implementations
- impl Default for MergeOptions
-
- fn default() -> MergeOptions
- pub struct gd_gettext::MergeStats¶
-
What a merge’s fuzzy search did;
merge_countedreturns it.Fields
- pub searches: usize¶
-
msgids searched for (each distinct msgid once).
- pub bounds: usize¶
-
Candidates whose byte counts were compared (the cheap bound).
- pub comparisons: usize¶
-
Candidates compared in full (
similarity).
- pub work: usize¶
-
Bytes those comparisons read.
- pub cut_short: usize¶
-
Searches the work bound stopped before they had looked everywhere.
- pub struct gd_gettext::Stats¶
-
Counts of a catalog’s messages, as sphinx-intl stat reports them.
Fields
- pub translated: usize¶
-
Translated and not fuzzy.
- pub fuzzy: usize¶
-
Translated but fuzzy.
- pub untranslated: usize¶
-
Missing a form.
- pub obsolete: usize¶
-
Obsolete (
#~).
Implementations
- impl Stats
-
- pub fn add(&mut self, m: &Message)¶
-
Counts one message, as sphinx-intl stat does; the header does not count. With a
crate::PoReader, this counts a file without holding it.
- pub struct gd_gettext::MoCatalog¶
-
A compiled catalog served from one text pool: the file’s strings.
It owns the pool (the file’s buffer, reused), a span per string, and a copy of the hash table; lookups (
Lookup) borrow from the pool and allocate nothing. Make one withMoCatalog::loadorMoCatalog::from_bytes; for an editable catalog, usecrate::parse_moinstead.Implementations
- impl MoCatalog
-
- pub fn load(path: impl AsRef<Path>, options: &LoadOptions) -> Result<MoCatalog, Error>¶
-
Reads and checks a compiled catalog. Fails when the file cannot be read, is larger than
options.max_bytes, or asMoCatalog::from_bytesfails.
- pub fn from_bytes(data: impl Into<Vec<u8>>, name: &str) -> Result<MoCatalog, Error>¶
-
Takes MO bytes and checks them once, so lookups need no checks.
Fails with
ErrorKind::MoFormatwhen the header, a table entry, or a string is truncated or out of bounds, when strings share bytes or keys repeat (no compiler writes either), or when a string is not UTF-8; withErrorKind::Charsetfor a header naming another charset, andErrorKind::Pluralfor a bad Plural-Forms.
- pub fn name(&self) -> &str¶
-
Returns the file name, or the name given to
MoCatalog::from_bytes.
- pub fn entry_count(&self) -> usize¶
-
Returns the number of entries, the header included.
- pub fn header(&self) -> Option<&str>¶
-
Returns the header entry’s text (the translation of 「」), if there is one.
Trait Implementations
- pub struct gd_gettext::MoEntry<'a>¶
-
One message of a
MoCatalog, borrowed from its buffer.Fields
- pub id: &'a str¶
-
The msgid.
- pub translation: &'a str¶
-
The translation as stored: plural forms joined by NUL.
Implementations
- pub struct gd_gettext::PluralProblem¶
-
Where and why an expression was refused.
Fields
- pub message: &'static str¶
-
What is wrong, in lower case without a full stop.
- pub column: usize¶
-
The 1-based byte column in the expression.
- pub struct gd_gettext::PluralRule¶
-
A compiled Plural-Forms header:
npluralsand the plural expression.Fields
- pub nplurals: usize¶
-
The number of plural forms, 1 to
MAX_NPLURALS.
Trait Implementations
- impl Default for PluralRule
-
- fn default() -> PluralRule
-
gettext’s rule without a header: two forms,
plural = n != 1.
- pub struct gd_gettext::PoReader<R>¶
-
Reads PO or POT entries one at a time from any buffered source, so a large file need not be held whole.
It is an iterator of
Result<Message, Error>: the header entry first when the file has one (Message::is_header), then the messages, obsolete ones included, in file order. After an error it yields nothing more. It keeps only the current entry and the keys seen so far (to report duplicates), plus one reused line buffer.use gd_gettext::{PoReader, Stats}; let text = "msgid \"a\"\nmsgstr \"b\"\n\nmsgid \"c\"\nmsgstr \"\"\n"; let mut stats = Stats::default(); for message in PoReader::new(text.as_bytes(), "de.po") { stats.add(&message?); } assert_eq!((stats.translated, stats.untranslated), (1, 1));
Implementations
- impl<R: BufRead> PoReader<R>
-
- pub fn new(source: R, name: &str) -> PoReader<R>¶
-
Returns a reader of
source;namelabels errors. There is no size limit.
- pub fn plural_rule(&self) -> &PluralRule¶
-
Returns the Plural-Forms rule of the header read so far (
n != 1before it).
- impl PoReader<BufReader<File>>
-
- pub fn open(path: impl AsRef<Path>, options: &LoadOptions) -> Result<Self, Error>¶
-
Opens a PO or POT file for reading entry by entry. Fails when it cannot be opened or is larger than
options.max_bytes; reading stops with the same error if it grows past the limit.
Trait Implementations
- pub struct gd_gettext::WriteOptions¶
-
How
write_polays a catalog out. The default wraps at 76 columns, as sphinx-intl (through Babel) does, and writes previous msgids and obsolete messages.Fields
- pub width: usize¶
-
Lines are wrapped to this many characters; 0: no wrapping.
- pub references: ReferenceStyle¶
-
How locations are written.
- pub previous: bool¶
-
Write
#|previous msgids of fuzzy messages.
- pub obsolete: bool¶
-
Write
#~obsolete messages.
Trait Implementations
- impl Default for WriteOptions
-
- fn default() -> WriteOptions
- pub struct gd_gettext::BoundCatalog¶
-
A catalog a translator serves for a domain.
Fields
- pub struct gd_gettext::Translator¶
-
Serves several text domains, each from a chain of catalogs: the first bound catalog that translates a message wins, as Sphinx searches
locale_dirsin order before its own catalogs. It stands in for the C library’s global state (bindtextdomain, textdomain, setlocale).Fields
- pub bound: Vec<BoundCatalog>¶
-
The bound catalogs, in search order.
Implementations
- impl Translator
-
- pub fn new(language: &str) -> Translator¶
-
Returns a translator for
languagewith no catalogs bound, in themessagesdomain.
- pub fn add_catalog(&mut self, domain: &str, catalog: impl Lookup + Send + Sync + 'static)¶
-
Binds a catalog to a domain after those already bound; the translator owns it.
- pub fn text_domain(&mut self, domain: &str)¶
-
Sets the current domain, as textdomain does.
- pub fn bind_text_domain(&mut self, domain: &str, dir: &Path, options: &LoadOptions) -> Result<bool, Error>¶
-
Looks for
dir/<language>/LC_MESSAGES/<domain>.po, then.mo, trying the language, then its base language (pt_BR, then pt), and binds the first catalog found: a.mofile as a zero-copyMoCatalog, a.pofile as an editable catalog. ReturnsOk(false)when there is none; fails when the file found cannot be read or parsed, or is larger thanoptions.max_bytes.
- pub fn domain_text<'a>(&'a self, domain: &str, id: &'a str) -> &'a str¶
-
dgettext: the translation of
idin a domain, orid.
- pub fn domain_with_context<'a>(&'a self, domain: &str, ctx: &str, id: &'a str) -> &'a str¶
-
dpgettext:
Translator::domain_textin contextctx.
- pub fn domain_plural<'a>(&'a self, domain: &str, id: &'a str, id_plural: &'a str, n: u64) -> &'a str¶
-
dngettext: the form for
nin a domain, or the English singular or plural.
- pub fn domain_plural_with_context<'a>(&'a self, domain: &str, ctx: Option<&str>, id: &'a str, id_plural: &'a str, n: u64) -> &'a str¶
-
dnpgettext:
Translator::domain_pluralwith an optional context.
- pub fn text<'a>(&'a self, id: &'a str) -> &'a str¶
-
gettext in the current domain.
- pub fn plural<'a>(&'a self, id: &'a str, id_plural: &'a str, n: u64) -> &'a str¶
-
ngettext in the current domain.
- pub fn with_context<'a>(&'a self, ctx: &str, id: &'a str) -> &'a str¶
-
pgettext in the current domain.
- pub fn plural_with_context<'a>(&'a self, ctx: &str, id: &'a str, id_plural: &'a str, n: u64) -> &'a str¶
-
npgettext in the current domain.
Enums
- pub enum gd_gettext::ErrorKind¶
-
What kind of problem an
Errorreports.Variants
- Syntax¶
-
The PO text breaks the format.
- Duplicate¶
-
A message is defined twice.
- Charset¶
-
The catalog is not UTF-8.
- Encoding¶
-
Bytes that are not valid UTF-8.
- Plural¶
-
A Plural-Forms header that cannot be used.
- MoFormat¶
-
A truncated or inconsistent MO file.
- Io¶
-
The file could not be read or written.
- Memory¶
-
There was not enough memory to hold the catalog.
- TooLarge¶
-
The file is larger than
crate::LoadOptions::max_bytes.
Implementations
- pub enum gd_gettext::MoSearch¶
-
How a
MoCatalogfinds a key.Variants
- Hash { size: u32, probes: u32 }¶
-
Through the file’s hash table: one to a few probes.
probesis the most any key of the file takes, so a lookup of a missing key stops there too.- size: u32¶
-
The table’s size (a prime).
- probes: u32¶
-
The most probes a key of the file takes.
- Sorted¶
-
Binary search on the original-string table, which is sorted.
- pub enum gd_gettext::ReferenceStyle¶
-
How
#:locations are written.Variants
- Wrapped¶
-
#: a.rst:1 b.rst:2, wrapped at the width, as msgmerge writes.
- OnePerLine¶
-
One
#:line per location, as Sphinx’s gettext builder writes.
- None¶
-
No locations (
gettext_location = False).
Traits
- pub trait gd_gettext::Lookup: fmt::Debug¶
-
The gettext lookups, for any catalog that can find a message’s forms.
Implementors provide
Lookup::findandLookup::plural_rule; the C library’s gettext, ngettext, pgettext and npgettext follow from them. Every string returned is borrowed from the catalog, or is theidpassed in.- fn find(&self, id: &str, ctx: Option<&str>) -> Option<Forms<'_>>¶
-
Returns the translated forms of a message;
ctxNonemeans no context. A message without a translation is not found.
- fn plural_rule(&self) -> &PluralRule¶
-
Returns the catalog’s compiled Plural-Forms rule.
- fn translation(&self, id: &str, ctx: Option<&str>) -> Option<&str>¶
-
Returns a message’s singular translation when it has a non-empty one.
- fn text<'a>(&'a self, id: &'a str) -> &'a str¶
-
gettext: returns the translation of
id, oriditself.
- fn with_context<'a>(&'a self, ctx: &str, id: &'a str) -> &'a str¶
-
pgettext: returns the translation of
idin contextctx, oriditself.
- fn plural<'a>(&'a self, id: &'a str, id_plural: &'a str, n: u64) -> &'a str¶
-
ngettext: returns the form for
n, or the English singular (n == 1) or plural when there is no translation or the form is empty.
- fn plural_with_context<'a>(&'a self, ctx: Option<&str>, id: &'a str, id_plural: &'a str, n: u64) -> &'a str¶
-
npgettext:
Lookup::pluralwith an optional context.
Implementors
Functions
- pub fn gd_gettext::format_stats(s: &Stats) -> String¶
-
Returns sphinx-intl’s summary line:
3 translated, 1 fuzzy, 2 untranslated.
- pub fn gd_gettext::merge(def: &Catalog, reference: &Catalog, options: &MergeOptions) -> Catalog¶
-
Updates a translation (
def) to a new template (reference), as msgmerge and sphinx-intl update do, and returns the result as a new catalog; both inputs are borrowed. The result has the template’s messages in the template’s order, with its locations, notes, and flags:- a message found in
defkeeps its translation, translator comments, and fuzzy flag; - a new message similar to an old translated one gets that translation, marked fuzzy, with the old msgid kept as its previous msgid (
#|); - old translated messages the template lost become obsolete (
#~).
The header is
def’s, with the template’s POT-Creation-Date. - a message found in
- pub fn gd_gettext::merge_counted(def: &Catalog, reference: &Catalog, options: &MergeOptions) -> (Catalog, MergeStats)¶
-
merge, also returning what its fuzzy search did.
- pub fn gd_gettext::similarity(a: &str, b: &str) -> f64¶
-
2·M / (|a| + |b|), where M is the length of the longest common subsequence of bytes: 1 for equal strings, 0 for strings with nothing in common. It is the measure msgmerge’s fstrcmp approximates. Long strings are compared by their first 2000 bytes.
- pub fn gd_gettext::sort_by_reference(cat: &mut Catalog)¶
-
Orders messages by their first location: file name, then line number as a number, then msgid; messages without locations go last. Obsolete messages keep their place after the live ones. Each message’s own locations are sorted the same way, as Sphinx sorts them.
- pub fn gd_gettext::stats(cat: &Catalog) -> Stats¶
-
Counts a catalog’s messages as sphinx-intl stat does; the header does not count.
- pub fn gd_gettext::load_mo(path: impl AsRef<Path>, options: &LoadOptions) -> Result<crate::Catalog, Error>¶
-
Reads a compiled catalog into an editable
crate::Catalog(strings copied). UseMoCatalog::loadto look up without copying.Fails as
MoCatalog::loadfails.
- pub fn gd_gettext::parse_mo(data: &[u8], name: &str) -> Result<crate::Catalog, Error>¶
-
Decodes MO bytes into an editable
crate::Catalogthat copies what it keeps, sodatais only borrowed. Fails asMoCatalog::from_bytesfails, or withErrorKind::Memorywhen the copy cannot be allocated.
- pub fn gd_gettext::save_mo(cat: &Catalog, path: impl AsRef<Path>, include_fuzzy: bool) -> Result<(), Error>¶
-
Compiles a catalog into a file, through a buffer. See
write_mo_to.
- pub fn gd_gettext::write_mo(cat: &Catalog, include_fuzzy: bool) -> Result<Vec<u8>, Error>¶
-
Compiles a catalog as msgfmt does and returns the bytes. See
write_mo_to.
- pub fn gd_gettext::write_mo_to(out: &mut impl Write, cat: &Catalog, include_fuzzy: bool) -> Result<(), Error>¶
-
Compiles a catalog into
outas msgfmt does: the header and every translated message, sorted by key, with a hash table, little-endian. Fuzzy messages are left out unlessinclude_fuzzy; obsolete and untranslated ones always are; of messages with the same key, the first is written. The output depends only on the catalog.The strings are written straight from the catalog; only the tables are built in memory. Pass a buffered writer: entries are written piece by piece. Fails with
ErrorKind::Iowhen writing fails, andErrorKind::MoFormatwhen the output would pass the format’s 4 GiB of offsets.
- pub fn gd_gettext::compile_plural(expr: &str, nplurals: usize) -> Result<PluralRule, PluralProblem>¶
-
Compiles a plural expression for
npluralsforms. Fails with the first problem found: a syntax error, nplurals out of 1 to 32, or an expression past the node or depth bounds.
- pub fn gd_gettext::parse_plural_forms(value: &str) -> Result<PluralRule, Error>¶
-
Compiles a Plural-Forms header value such as
nplurals=2; plural=(n != 1);. Fails with an error of kindErrorKind::Pluralwhose excerpt is the value and whose column points at the problem; the caller fills in the file and line.
- pub fn gd_gettext::plural_forms_for(language: &str) -> &'static str¶
-
Returns a Plural-Forms header value for a new catalog of a language: the rules the GNU gettext manual lists for common languages, and the germanic rule (
n != 1) for others.pt_BRandpt-BRfindpt_BR, thenpt.
- pub fn gd_gettext::plural_index(rule: &PluralRule, n: u64) -> usize¶
-
Returns the msgstr index for
n; a result out of range selects form 0, as the C library does.
- pub fn gd_gettext::load_po(path: impl AsRef<Path>, options: &LoadOptions) -> Result<Catalog, Error>¶
-
Reads a PO or POT file into an editable catalog, entry by entry through a buffer.
Fails when the file cannot be read or is larger than
options.max_bytes, or asparse_pofails.
- pub fn gd_gettext::parse_po(text: &str, name: &str) -> Result<Catalog, Error>¶
-
Parses PO or POT text into an editable catalog;
namelabels errors and the catalog, andtextis only borrowed.Fails on the first syntax error, a duplicate message, a header naming a charset other than UTF-8, or an invalid Plural-Forms header; the error names the line and column.
- pub fn gd_gettext::parse_po_bytes(data: &[u8], name: &str) -> Result<Catalog, Error>¶
-
parse_pofor bytes that may not be UTF-8: fails withErrorKind::Encodingat the first byte that does not start a character.
- pub fn gd_gettext::escape_string(s: &str) -> Cow<'_, str>¶
-
Escapes a value for a PO string body: backslash, quote, and the control characters C names (others as octal). Borrows
swhen nothing needs escaping.
- pub fn gd_gettext::save_po(cat: &Catalog, path: impl AsRef<Path>, options: &WriteOptions) -> Result<(), Error>¶
-
Writes a catalog to a file as
write_poformats it, entry by entry through a buffer. Fails withErrorKind::Iowhen the file cannot be written.
- pub fn gd_gettext::write_po(cat: &Catalog, options: &WriteOptions) -> String¶
-
Returns a catalog as PO text: the header, then the messages in order, then the obsolete ones, each entry laid out as msgmerge lays it out. The output depends on nothing but the catalog and the options, so files diff cleanly.
- pub fn gd_gettext::write_po_into(out: &mut String, cat: &Catalog, options: &WriteOptions)¶
-
write_poappending toout, so a caller can reuse one buffer for many catalogs.
- pub fn gd_gettext::write_po_to(out: &mut impl Write, cat: &Catalog, options: &WriteOptions) -> Result<(), Error>¶
-
write_postreaming intooutone entry at a time, through one reused buffer, so the whole text is never held. Pass a buffered writer for a file. Fails withErrorKind::Iowhen writing fails.
- pub fn gd_gettext::find_catalog_file(dir: &Path, language: &str, domain: &str) -> Option<PathBuf>¶
-
Returns the path of a domain’s catalog for a language,
dir/<lang>/LC_MESSAGES/<domain>.po(or.mo), trying each oflanguage_candidates;Nonewhen there is none.
- pub fn gd_gettext::language_candidates(language: &str) -> Vec<String>¶
-
Lists the catalog directory names to try for a language, most specific first:
pt-BRgivespt-BR,pt_BR, andpt;sr@latingives it, thensr. Empty for an empty language.
Constants
- pub const gd_gettext::FUZZY_MIN_WORK: usize = 1 << 26¶
-
The least work a merge’s fuzzy search is allowed.
- pub const gd_gettext::FUZZY_WORK_PER_BYTE: usize = 256¶
-
Bytes a merge’s fuzzy search may read per byte of the two catalogs』 msgids.
- pub const gd_gettext::FUZZY_THRESHOLD: f64 = 0.6¶
-
msgmerge’s threshold: a changed message inherits the translation of the most similar old message when their similarity is at least this.
- pub const gd_gettext::MAX_NPLURALS: usize = 32¶
-
The most plural forms a catalog may have.
- pub const gd_gettext::MAX_PLURAL_DEPTH: usize = 100¶
-
The deepest a plural expression may nest (parser levels).
- pub const gd_gettext::MAX_PLURAL_NODES: usize = 128¶
-
The most nodes a compiled plural expression may have.