pub struct Translation { /* private fields */ }Expand description
Translation entry for a single localizable string.
Tracks both the source and translated text, along with status flags indicating whether the translation is up-to-date, was generated automatically, or refers to a string no longer present in the pack.
Field names were shortened in the new format; serde aliases keep
backwards-compatible deserialization of the old field names. The old
per-entry key field is no longer stored — the map key in
PackTranslation::translations is the authoritative identifier — and
extra fields in legacy files are silently ignored.
Implementations§
Source§impl Translation
impl Translation
Sourcepub fn src(&self) -> &String
pub fn src(&self) -> &String
Source text in the base language (typically English).
Used to detect when the source text changes, requiring re-translation.
Sourcepub fn dst(&self) -> &String
pub fn dst(&self) -> &String
Translated text in the target language.
May be empty if not yet translated.
Sourcepub fn retr(&self) -> &bool
pub fn retr(&self) -> &bool
Whether this translation needs review because the source text changed after the previous translation.
Source§impl Translation
impl Translation
Sourcepub fn src_mut(&mut self) -> &mut String
pub fn src_mut(&mut self) -> &mut String
Source text in the base language (typically English).
Used to detect when the source text changes, requiring re-translation.
Sourcepub fn dst_mut(&mut self) -> &mut String
pub fn dst_mut(&mut self) -> &mut String
Translated text in the target language.
May be empty if not yet translated.
Sourcepub fn retr_mut(&mut self) -> &mut bool
pub fn retr_mut(&mut self) -> &mut bool
Whether this translation needs review because the source text changed after the previous translation.
Source§impl Translation
impl Translation
Sourcepub fn set_src(&mut self, val: String) -> &mut Self
pub fn set_src(&mut self, val: String) -> &mut Self
Source text in the base language (typically English).
Used to detect when the source text changes, requiring re-translation.
Sourcepub fn set_dst(&mut self, val: String) -> &mut Self
pub fn set_dst(&mut self, val: String) -> &mut Self
Translated text in the target language.
May be empty if not yet translated.
Sourcepub fn set_retr(&mut self, val: bool) -> &mut Self
pub fn set_retr(&mut self, val: bool) -> &mut Self
Whether this translation needs review because the source text changed after the previous translation.
Trait Implementations§
Source§impl Clone for Translation
impl Clone for Translation
Source§fn clone(&self) -> Translation
fn clone(&self) -> Translation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Translation
impl Debug for Translation
Source§impl Default for Translation
impl Default for Translation
Source§fn default() -> Translation
fn default() -> Translation
Source§impl<'de> Deserialize<'de> for Translation
impl<'de> Deserialize<'de> for Translation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Translation
impl RefUnwindSafe for Translation
impl Send for Translation
impl Sync for Translation
impl Unpin for Translation
impl UnsafeUnpin for Translation
impl UnwindSafe for Translation
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeSend for T
impl<T> MaybeSync for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.