pub struct Translations { /* private fields */ }Expand description
Provides translated text strings for UI elements.
This struct contains all UI text translations used in the search dialog, including placeholders, tooltips, and labels.
§Examples
use iced_code_editor::{Language, Translations};
let translations = Translations::new(Language::French);
assert_eq!(translations.search_placeholder(), "Rechercher...");Implementations§
Source§impl Translations
impl Translations
Sourcepub fn new(language: Language) -> Self
pub fn new(language: Language) -> Self
Creates a new Translations instance with the specified language.
This sets the global rust-i18n locale to the specified language.
§Examples
use iced_code_editor::{Language, Translations};
let translations = Translations::new(Language::Spanish);
assert_eq!(translations.language(), Language::Spanish);Sourcepub const fn language(&self) -> Language
pub const fn language(&self) -> Language
Returns the current language.
§Examples
use iced_code_editor::{Language, Translations};
let translations = Translations::new(Language::French);
assert_eq!(translations.language(), Language::French);Sourcepub fn set_language(&mut self, language: Language)
pub fn set_language(&mut self, language: Language)
Sets the language for translations.
This updates the global rust-i18n locale.
§Examples
use iced_code_editor::{Language, Translations};
let mut translations = Translations::new(Language::English);
translations.set_language(Language::Spanish);
assert_eq!(translations.language(), Language::Spanish);Sourcepub fn search_placeholder(&self) -> String
pub fn search_placeholder(&self) -> String
Returns the placeholder text for the search input field.
§Examples
use iced_code_editor::{Language, Translations};
let en = Translations::new(Language::English);
assert_eq!(en.search_placeholder(), "Search...");
let fr = Translations::new(Language::French);
assert_eq!(fr.search_placeholder(), "Rechercher...");Sourcepub fn replace_placeholder(&self) -> String
pub fn replace_placeholder(&self) -> String
Returns the placeholder text for the replace input field.
§Examples
use iced_code_editor::{Language, Translations};
let es = Translations::new(Language::Spanish);
assert_eq!(es.replace_placeholder(), "Reemplazar...");Sourcepub fn case_sensitive_label(&self) -> String
pub fn case_sensitive_label(&self) -> String
Returns the label text for the case sensitive checkbox.
§Examples
use iced_code_editor::{Language, Translations};
let fr = Translations::new(Language::French);
assert_eq!(fr.case_sensitive_label(), "Sensible à la casse");Sourcepub fn previous_match_tooltip(&self) -> String
pub fn previous_match_tooltip(&self) -> String
Returns the tooltip text for the previous match button.
§Examples
use iced_code_editor::{Language, Translations};
let en = Translations::new(Language::English);
assert_eq!(en.previous_match_tooltip(), "Previous match (Shift+F3)");Sourcepub fn next_match_tooltip(&self) -> String
pub fn next_match_tooltip(&self) -> String
Returns the tooltip text for the next match button.
§Examples
use iced_code_editor::{Language, Translations};
let es = Translations::new(Language::Spanish);
assert_eq!(es.next_match_tooltip(), "Siguiente coincidencia (F3 / Enter)");Sourcepub fn close_search_tooltip(&self) -> String
pub fn close_search_tooltip(&self) -> String
Returns the tooltip text for the close search dialog button.
§Examples
use iced_code_editor::{Language, Translations};
let fr = Translations::new(Language::French);
assert_eq!(fr.close_search_tooltip(), "Fermer la recherche (Échap)");Sourcepub fn replace_current_tooltip(&self) -> String
pub fn replace_current_tooltip(&self) -> String
Returns the tooltip text for the replace current match button.
§Examples
use iced_code_editor::{Language, Translations};
let en = Translations::new(Language::English);
assert_eq!(en.replace_current_tooltip(), "Replace current match");Sourcepub fn replace_all_tooltip(&self) -> String
pub fn replace_all_tooltip(&self) -> String
Returns the tooltip text for the replace all matches button.
§Examples
use iced_code_editor::{Language, Translations};
let es = Translations::new(Language::Spanish);
assert_eq!(es.replace_all_tooltip(), "Reemplazar todo");Trait Implementations§
Source§impl Clone for Translations
impl Clone for Translations
Source§fn clone(&self) -> Translations
fn clone(&self) -> Translations
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Translations
impl Debug for Translations
Source§impl Default for Translations
impl Default for Translations
Source§fn default() -> Translations
fn default() -> Translations
impl Copy for Translations
Auto Trait Implementations§
impl Freeze for Translations
impl RefUnwindSafe for Translations
impl Send for Translations
impl Sync for Translations
impl Unpin for Translations
impl UnwindSafe for Translations
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.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