Struct translate_storage::Unit
[−]
[src]
pub struct Unit { /* fields omitted */ }
Elementary unit of translation.
A translation unit contains:
- One source string, the original message.
- At most one target string, the translated message.
- Optional context string that disambiguates the original.
- A status. This indicates whether the unit is usable in the software.
Additionally, it can also contain: - Notes, from developer or translator. - References back into the source where the unit is used. - Previous source and context if the target is automatic suggestion from fuzzy matching. - Obsolete flag, indicating the unit is not currently in use.
Methods
impl Unit
[src]
fn context(&self) -> &Option<String>
Get the context string.
fn source(&self) -> &Message
Get the source string.
fn target(&self) -> &Message
Get the target string.
fn prev_context(&self) -> &Option<String>
Get the previous context (in fuzzy units).
fn prev_source(&self) -> &Message
Get the previous source (in fuzzy units).
fn notes(&self) -> &Vec<(Origin, String)>
Get the notes/comments.
fn locations(&self) -> &Vec<String>
Get locations.
fn state(&self) -> State
Get the state.
fn is_translated(&self) -> bool
Returns whether the unit should be used in application.
fn is_obsolete(&self) -> bool
Returns whether the unit is obsolete.
Trait Implementations
impl Clone for Unit
[src]
fn clone(&self) -> Unit
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more