pub struct MessageEntry {
pub msgid: String,
pub msgctxt: Option<String>,
pub msgstr: String,
pub msgid_plural: Option<String>,
pub msgstr_plural: Vec<String>,
pub extracted_comment: Vec<String>,
pub translator_comment: Vec<String>,
pub source_locations: Vec<String>,
pub flags: Vec<String>,
pub previous_msgid: Option<String>,
}Expand description
Represents a single translation entry in a PO file.
The header entry is also a MessageEntry — it’s the one whose
msgid is empty and whose msgstr is the Key: Value\n header block.
Fields§
§msgid: StringMessage ID (singular form, typically English).
msgctxt: Option<String>Optional context for disambiguation (msgctxt).
msgstr: StringTranslated string (singular form).
msgid_plural: Option<String>Plural form of the source string (msgid_plural).
msgstr_plural: Vec<String>Plural translations: [0] = singular, [1] = plural, etc.
extracted_comment: Vec<String>Developer/extracted comments (lines starting with #.).
translator_comment: Vec<String>Translator comments (lines starting with # ).
source_locations: Vec<String>Source code locations (lines starting with #:).
flags: Vec<String>Flags like fuzzy, c-format, python-format (lines starting #,).
previous_msgid: Option<String>Previous untranslated string (line starting with #|).
Implementations§
Source§impl MessageEntry
impl MessageEntry
Sourcepub fn is_translated(&self) -> bool
pub fn is_translated(&self) -> bool
True when the entry is fully translated per GNU gettext semantics.
Fuzzy entries are not considered translated: the gettext runtime silently ignores them, so for our purposes they’re untranslated.
Trait Implementations§
Source§impl Clone for MessageEntry
impl Clone for MessageEntry
Source§fn clone(&self) -> MessageEntry
fn clone(&self) -> MessageEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more