1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/// Groups together labels from different elements of the [`DockArea`](crate::DockArea).
#[derive(Clone, Debug)]
#[cfg_attr(
feature = "serde",
derive(serde::Deserialize, serde::Serialize),
serde(default)
)]
pub struct Translations {
/// Text overrides for buttons in tab context menus.
pub tab_context_menu: TabContextMenuTranslations,
/// Text overrides for buttons in windows.
pub leaf: LeafTranslations,
}
/// Specifies text in buttons displayed in the context menu displayed upon right-clicking on a tab.
#[derive(Clone, Debug)]
#[cfg_attr(
feature = "serde",
derive(serde::Deserialize, serde::Serialize),
serde(default)
)]
pub struct TabContextMenuTranslations {
/// Button that closes the tab.
pub close_button: String,
/// Button that undocks the tab into a new window.
pub eject_button: String,
/// Button that hides the tab bar.
pub hide_tab_bar_button: String,
/// Button that shows the tab bar.
pub show_tab_bar_button: String,
}
/// Specifies text displayed in the primary buttons on a tab bar.
#[derive(Clone, Debug)]
#[cfg_attr(
feature = "serde",
derive(serde::Deserialize, serde::Serialize),
serde(default)
)]
pub struct LeafTranslations {
/// Message in the tooltip shown while hovering over a grayed out X button of a leaf
/// containing non-closable tabs.
pub close_button_disabled_tooltip: String,
/// Button that closes the entire window.
pub close_all_button: String,
/// Message in the tooltip shown while hovering over an X button of a window.
/// Used when the secondary buttons are accessible from the context menu.
pub close_all_button_menu_hint: String,
/// Message in the tooltip shown while hovering over an X button of a window.
/// Used when the secondary buttons are accessible using modifiers.
pub close_all_button_modifier_hint: String,
/// Message in the tooltip shown while hovering over an X button of a window.
/// Used when the secondary buttons are accessible using modifiers and from the context menu.
pub close_all_button_modifier_menu_hint: String,
/// Message in the tooltip shown while hovering over a grayed out close window button of a window
/// containing non-closable tabs.
pub close_all_button_disabled_tooltip: String,
/// Button that minimizes the window.
pub minimize_button: String,
/// Message in the tooltip shown while hovering over a collapse button of a leaf.
/// Used when the secondary buttons are accessible from the context menu.
pub minimize_button_menu_hint: String,
/// Message in the tooltip shown while hovering over a collapse button of a leaf.
/// Used when the secondary buttons are accessible using modifiers.
pub minimize_button_modifier_hint: String,
/// Message in the tooltip shown while hovering over a collapse button of a leaf.
/// Used when the secondary buttons are accessible using modifiers and from the context menu.
pub minimize_button_modifier_menu_hint: String,
}
impl Translations {
/// Default English translations.
pub fn english() -> Self {
Self {
tab_context_menu: TabContextMenuTranslations::english(),
leaf: LeafTranslations::english(),
}
}
}
impl Default for Translations {
fn default() -> Self {
Self::english()
}
}
impl TabContextMenuTranslations {
/// Default English translations.
pub fn english() -> Self {
Self {
close_button: String::from("Close"),
eject_button: String::from("Eject"),
hide_tab_bar_button: String::from("Hide tab bar"),
show_tab_bar_button: String::from("Show tab bar"),
}
}
}
impl Default for TabContextMenuTranslations {
fn default() -> Self {
Self::english()
}
}
impl LeafTranslations {
/// Default English translations.
pub fn english() -> Self {
Self {
close_button_disabled_tooltip: String::from("This leaf contains non-closable tabs."),
close_all_button: String::from("Close window"),
close_all_button_menu_hint: String::from("Right click to close this window."),
close_all_button_modifier_hint: String::from(
"Press modifier keys (Shift by default) to close this window.",
),
close_all_button_modifier_menu_hint: String::from(
"Press modifier keys (Shift by default) or right click to close this window.",
),
close_all_button_disabled_tooltip: String::from(
"This window contains non-closable tabs.",
),
minimize_button: String::from("Minimize window"),
minimize_button_menu_hint: String::from("Right click to minimize this window."),
minimize_button_modifier_hint: String::from(
"Press modifier keys (Shift by default) to minimize this window.",
),
minimize_button_modifier_menu_hint: String::from(
"Press modifier keys (Shift by default) or right click to minimize this window.",
),
}
}
}
impl Default for LeafTranslations {
fn default() -> Self {
Self::english()
}
}