pub struct Translation { /* private fields */ }Expand description
Translation entry for a single localizable string.
Tracks both the original and translated text, along with status flags indicating whether the translation is up-to-date.
Implementations§
Source§impl Translation
impl Translation
Sourcepub fn value_original(&self) -> &String
pub fn value_original(&self) -> &String
Original text in the base language (typically English).
This is used to detect when the source text changes, requiring re-translation.
Sourcepub fn value_translated(&self) -> &String
pub fn value_translated(&self) -> &String
Translated text in the target language.
May be empty if not yet translated.
Sourcepub fn needs_retranslation(&self) -> &bool
pub fn needs_retranslation(&self) -> &bool
Whether this translation needs review.
Set to true when the original text changes after translation,
indicating the translation may be outdated.
Source§impl Translation
impl Translation
Sourcepub fn value_original_mut(&mut self) -> &mut String
pub fn value_original_mut(&mut self) -> &mut String
Original text in the base language (typically English).
This is used to detect when the source text changes, requiring re-translation.
Sourcepub fn value_translated_mut(&mut self) -> &mut String
pub fn value_translated_mut(&mut self) -> &mut String
Translated text in the target language.
May be empty if not yet translated.
Sourcepub fn needs_retranslation_mut(&mut self) -> &mut bool
pub fn needs_retranslation_mut(&mut self) -> &mut bool
Whether this translation needs review.
Set to true when the original text changes after translation,
indicating the translation may be outdated.
Sourcepub fn removed_mut(&mut self) -> &mut bool
pub fn removed_mut(&mut self) -> &mut bool
Whether this string has been removed from the source pack.
Translations for removed strings are kept for reference but marked as removed. If the string reappears, it will be flagged for re-translation.
Source§impl Translation
impl Translation
Sourcepub fn set_value_original(&mut self, val: String) -> &mut Self
pub fn set_value_original(&mut self, val: String) -> &mut Self
Original text in the base language (typically English).
This is used to detect when the source text changes, requiring re-translation.
Sourcepub fn set_value_translated(&mut self, val: String) -> &mut Self
pub fn set_value_translated(&mut self, val: String) -> &mut Self
Translated text in the target language.
May be empty if not yet translated.
Sourcepub fn set_needs_retranslation(&mut self, val: bool) -> &mut Self
pub fn set_needs_retranslation(&mut self, val: bool) -> &mut Self
Whether this translation needs review.
Set to true when the original text changes after translation,
indicating the translation may be outdated.
Sourcepub fn set_removed(&mut self, val: bool) -> &mut Self
pub fn set_removed(&mut self, val: bool) -> &mut Self
Whether this string has been removed from the source pack.
Translations for removed strings are kept for reference but marked as removed. If the string reappears, it will be flagged for re-translation.
Trait Implementations§
Source§impl Clone for Translation
impl Clone for Translation
Source§fn clone(&self) -> Translation
fn clone(&self) -> Translation
1.0.0 · 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more§impl<T> Pointable for T
impl<T> Pointable for T
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.