Struct titanium::desktop::gui::libdruid::LocalizedString
pub struct LocalizedString<T> { /* private fields */ }
Expand description
A string that can be localized based on the current locale.
At its simplest, a LocalizedString
is a key that can be resolved
against a map of localized strings for a given locale.
Implementations§
§impl<T> LocalizedString<T>
impl<T> LocalizedString<T>
pub const fn new(key: &'static str) -> LocalizedString<T>
pub const fn new(key: &'static str) -> LocalizedString<T>
Create a new LocalizedString
with the given key.
pub fn with_placeholder(
self,
placeholder: impl Into<Arc<str>>
) -> LocalizedString<T>
pub fn with_placeholder( self, placeholder: impl Into<Arc<str>> ) -> LocalizedString<T>
Add a placeholder value. This will be used if localization fails.
This is intended for use during prototyping.
pub fn localized_str(&self) -> Arc<str>
pub fn localized_str(&self) -> Arc<str>
Return the localized value for this string, or the placeholder, if the localization is missing, or the key if there is no placeholder.
Trait Implementations§
§impl<T> Clone for LocalizedString<T>where
T: Clone,
impl<T> Clone for LocalizedString<T>where T: Clone,
§fn clone(&self) -> LocalizedString<T>
fn clone(&self) -> LocalizedString<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl<T> Debug for LocalizedString<T>where
T: Debug,
impl<T> Debug for LocalizedString<T>where T: Debug,
§impl<T> From<LocalizedString<T>> for LabelText<T>
impl<T> From<LocalizedString<T>> for LabelText<T>
§fn from(src: LocalizedString<T>) -> LabelText<T>
fn from(src: LocalizedString<T>) -> LabelText<T>
Converts to this type from the input type.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for LocalizedString<T>
impl<T> !Send for LocalizedString<T>
impl<T> !Sync for LocalizedString<T>
impl<T> Unpin for LocalizedString<T>
impl<T> !UnwindSafe for LocalizedString<T>
Blanket Implementations§
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
§fn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,
§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.