pub struct GettextFile {
pub entries: IndexMap<(String, Option<String>), MessageEntry>,
pub metadata: IndexMap<String, String>,
pub obsolete_lines: Vec<String>,
}Expand description
A parsed PO file: ordered translation entries plus header metadata
plus any preserved obsolete (#~) lines.
Fields§
§entries: IndexMap<(String, Option<String>), MessageEntry>All translation entries, including the header at key ("", None).
metadata: IndexMap<String, String>Header metadata parsed out of the msgid "" entry’s msgstr.
obsolete_lines: Vec<String>Raw obsolete entry lines (#~ ...) preserved verbatim for
round-trip fidelity.
Implementations§
Source§impl GettextFile
impl GettextFile
Sourcepub fn plural_forms(&self) -> Option<String>
pub fn plural_forms(&self) -> Option<String>
Plural-Forms header, if set.
Sourcepub fn rebuild_header_entry(&mut self)
pub fn rebuild_header_entry(&mut self)
Rebuild the header entry’s msgstr from the current metadata map.
Called by store mutators that change a header value: the on-disk
representation is the joined Key: Value\n block, so the entry
has to be regenerated whenever a header changes.
Trait Implementations§
Source§impl Clone for GettextFile
impl Clone for GettextFile
Source§fn clone(&self) -> GettextFile
fn clone(&self) -> GettextFile
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GettextFile
impl Debug for GettextFile
Auto Trait Implementations§
impl Freeze for GettextFile
impl RefUnwindSafe for GettextFile
impl Send for GettextFile
impl Sync for GettextFile
impl Unpin for GettextFile
impl UnsafeUnpin for GettextFile
impl UnwindSafe for GettextFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more