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);Returns the platform-appropriate label for revealing a file.
Resolves to “Reveal in Finder” on macOS, “Reveal in File Explorer” on Windows, and “Open Containing Folder” elsewhere, so the menu matches the wording users already know from their own file manager.
§Examples
use iced_code_editor::{Language, Translations};
let en = Translations::new(Language::English);
let label = en.context_menu_reveal_in_file_manager();
// Whichever platform this runs on, it matches that platform's wording.
#[cfg(target_os = "macos")]
assert_eq!(label, en.context_menu_reveal_in_finder());
#[cfg(target_os = "windows")]
assert_eq!(label, en.context_menu_reveal_in_file_explorer());
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
assert_eq!(label, en.context_menu_open_containing_folder());Source§impl Translations
impl Translations
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};
assert_eq!(Translations::new(Language::English).search_placeholder(), "Search...");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};
assert_eq!(Translations::new(Language::English).replace_placeholder(), "Replace...");Sourcepub fn select_all_matches_tooltip(&self) -> String
pub fn select_all_matches_tooltip(&self) -> String
Tooltip for converting search results to selections.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).select_all_matches_tooltip(), "Select All Matches");Sourcepub fn whole_word_tooltip(&self) -> String
pub fn whole_word_tooltip(&self) -> String
Tooltip for whole-word search.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).whole_word_tooltip(), "Match Whole Words");Sourcepub fn regex_tooltip(&self) -> String
pub fn regex_tooltip(&self) -> String
Tooltip for regular expression search.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).regex_tooltip(), "Use Regular Expressions");Sourcepub fn multiline_tooltip(&self) -> String
pub fn multiline_tooltip(&self) -> String
Tooltip for multiline input.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).multiline_tooltip(), "Expand / Collapse Multiline Input");Sourcepub fn toggle_replace_tooltip(&self) -> String
pub fn toggle_replace_tooltip(&self) -> String
Tooltip for toggling replacement controls.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).toggle_replace_tooltip(), "Show / Hide Replace");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};
assert_eq!(Translations::new(Language::English).case_sensitive_label(), "Case sensitive");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};
assert_eq!(Translations::new(Language::English).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};
assert_eq!(Translations::new(Language::English).next_match_tooltip(), "Next match (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};
assert_eq!(Translations::new(Language::English).close_search_tooltip(), "Close search dialog (Esc)");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};
assert_eq!(Translations::new(Language::English).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};
assert_eq!(Translations::new(Language::English).replace_all_tooltip(), "Replace all matches");Returns the context-menu label for undo.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).context_menu_undo(), "Undo");Returns the context-menu label for redo.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).context_menu_redo(), "Redo");Returns the context-menu label for cut.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).context_menu_cut(), "Cut");Returns the context-menu label for copy.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).context_menu_copy(), "Copy");Returns the context-menu label for paste.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).context_menu_paste(), "Paste");Returns the context-menu label for select all.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).context_menu_select_all(), "Select All");Returns the macOS context-menu label for revealing a file.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).context_menu_reveal_in_finder(), "Reveal in Finder");Returns the Windows context-menu label for revealing a file.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).context_menu_reveal_in_file_explorer(), "Reveal in File Explorer");Returns the Linux context-menu label for opening a file’s parent folder.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).context_menu_open_containing_folder(), "Open Containing Folder");Sourcepub fn command_palette_placeholder(&self) -> String
pub fn command_palette_placeholder(&self) -> String
Returns the command-palette label for the filter input’s placeholder.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).command_palette_placeholder(), "Type a command...");Sourcepub fn command_palette_no_results(&self) -> String
pub fn command_palette_no_results(&self) -> String
Returns the command-palette label for the empty-result message.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).command_palette_no_results(), "No matching command");Sourcepub fn command_palette_save(&self) -> String
pub fn command_palette_save(&self) -> String
Returns the command-palette label for saving the document.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).command_palette_save(), "Save");Sourcepub fn command_palette_toggle_comment(&self) -> String
pub fn command_palette_toggle_comment(&self) -> String
Returns the command-palette label for toggling the line comment.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).command_palette_toggle_comment(), "Toggle Line Comment");Sourcepub fn command_palette_move_line_up(&self) -> String
pub fn command_palette_move_line_up(&self) -> String
Returns the command-palette label for moving the current line up.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).command_palette_move_line_up(), "Move Line Up");Sourcepub fn command_palette_move_line_down(&self) -> String
pub fn command_palette_move_line_down(&self) -> String
Returns the command-palette label for moving the current line down.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).command_palette_move_line_down(), "Move Line Down");Sourcepub fn command_palette_duplicate_line_up(&self) -> String
pub fn command_palette_duplicate_line_up(&self) -> String
Returns the command-palette label for duplicating the current line above.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).command_palette_duplicate_line_up(), "Duplicate Line Up");Sourcepub fn command_palette_duplicate_line_down(&self) -> String
pub fn command_palette_duplicate_line_down(&self) -> String
Returns the command-palette label for duplicating the current line below.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).command_palette_duplicate_line_down(), "Duplicate Line Down");Sourcepub fn command_palette_goto_line(&self) -> String
pub fn command_palette_goto_line(&self) -> String
Returns the command-palette label for jumping to a line.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).command_palette_goto_line(), "Go to Line");Sourcepub fn command_palette_add_cursor_above(&self) -> String
pub fn command_palette_add_cursor_above(&self) -> String
Returns the command-palette label for adding a cursor on the line above.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).command_palette_add_cursor_above(), "Add Cursor Above");Sourcepub fn command_palette_add_cursor_below(&self) -> String
pub fn command_palette_add_cursor_below(&self) -> String
Returns the command-palette label for adding a cursor on the line below.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).command_palette_add_cursor_below(), "Add Cursor Below");Sourcepub fn command_palette_select_next_occurrence(&self) -> String
pub fn command_palette_select_next_occurrence(&self) -> String
Returns the command-palette label for selecting the next occurrence.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).command_palette_select_next_occurrence(), "Select Next Occurrence");Sourcepub fn command_palette_toggle_vim_mode(&self) -> String
pub fn command_palette_toggle_vim_mode(&self) -> String
Returns the command-palette label for toggling Vim mode.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).command_palette_toggle_vim_mode(), "Toggle Vim Mode");Sourcepub fn command_palette_find(&self) -> String
pub fn command_palette_find(&self) -> String
Returns the command-palette label for opening the search dialog.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).command_palette_find(), "Find");Sourcepub fn command_palette_replace(&self) -> String
pub fn command_palette_replace(&self) -> String
Returns the command-palette label for opening the search-and-replace dialog.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).command_palette_replace(), "Replace");Sourcepub fn command_palette_fold_at_cursor(&self) -> String
pub fn command_palette_fold_at_cursor(&self) -> String
Returns the command-palette label for folding the block at the cursor.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).command_palette_fold_at_cursor(), "Toggle Fold at Cursor");Sourcepub fn command_palette_fold_all(&self) -> String
pub fn command_palette_fold_all(&self) -> String
Returns the command-palette label for folding every block.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).command_palette_fold_all(), "Fold All");Sourcepub fn command_palette_unfold_all(&self) -> String
pub fn command_palette_unfold_all(&self) -> String
Returns the command-palette label for unfolding every block.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).command_palette_unfold_all(), "Unfold All");Sourcepub fn command_palette_status_on(&self) -> String
pub fn command_palette_status_on(&self) -> String
Returns the command-palette badge shown on an enabled toggle command.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).command_palette_status_on(), "On");Sourcepub fn command_palette_status_off(&self) -> String
pub fn command_palette_status_off(&self) -> String
Returns the command-palette badge shown on a disabled toggle command.
§Examples
use iced_code_editor::{Language, Translations};
assert_eq!(Translations::new(Language::English).command_palette_status_off(), "Off");Trait Implementations§
Source§impl Clone for Translations
impl Clone for Translations
impl Copy for Translations
Source§impl Debug for Translations
impl Debug for Translations
Auto Trait Implementations§
impl Forget for Translations
impl Freeze for Translations
impl Move for Translations
impl RefUnwindSafe for Translations
impl Send for Translations
impl Sync for Translations
impl Unpin for Translations
impl UnsafeUnpin 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
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,
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.