Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1e6db58

Browse files
committed
Keep consistent language/punctuation/case throughout the app.
1 parent c973826 commit 1e6db58

6 files changed

Lines changed: 57 additions & 53 deletions

File tree

src/aggregate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub fn aggregate(
4444
stats.entries_traversed += 1;
4545
progress.throttled(|| {
4646
if let Some(err) = err.as_mut() {
47-
write!(err, "Enumerating {} entries\r", stats.entries_traversed).ok();
47+
write!(err, "Enumerating {} items\r", stats.entries_traversed).ok();
4848
}
4949
});
5050
match entry {

src/interactive/app/handlers.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl AppState {
207207
window.mark_pane = match res {
208208
Some((pane, mode)) => match mode {
209209
Some(MarkMode::Delete) => {
210-
self.message = Some("Deleting entries...".to_string());
210+
self.message = Some("Deleting items...".to_string());
211211
let mut entries_deleted = 0;
212212
let res = pane.iterate_deletable_items(|mut pane, entry_to_delete| {
213213
window.mark_pane = Some(pane);
@@ -217,7 +217,7 @@ impl AppState {
217217
Ok(ed) => {
218218
entries_deleted += ed;
219219
self.message =
220-
Some(format!("Deleted {} entries...", entries_deleted));
220+
Some(format!("Deleted {} items...", entries_deleted));
221221
Ok(pane)
222222
}
223223
Err(c) => Err((pane, c)),
@@ -228,7 +228,7 @@ impl AppState {
228228
}
229229
#[cfg(feature = "trash-move")]
230230
Some(MarkMode::Trash) => {
231-
self.message = Some("Trashing entries...".to_string());
231+
self.message = Some("Trashing items...".to_string());
232232
let mut entries_trashed = 0;
233233
let res = pane.iterate_deletable_items(|mut pane, entry_to_trash| {
234234
window.mark_pane = Some(pane);
@@ -238,7 +238,7 @@ impl AppState {
238238
Ok(ed) => {
239239
entries_trashed += ed;
240240
self.message =
241-
Some(format!("Trashed {} entries...", entries_trashed));
241+
Some(format!("Trashed {} items...", entries_trashed));
242242
Ok(pane)
243243
}
244244
Err(c) => Err((pane, c)),

src/interactive/app/tests/journeys_readonly.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fn simple_user_journey_read_only() -> Result<()> {
3636
assert_eq!(
3737
app.state.sorting,
3838
SortMode::SizeDescending,
39-
"it will sort entries in descending order by size"
39+
"it will sort items in descending order by size"
4040
);
4141

4242
assert!(
@@ -97,7 +97,7 @@ fn simple_user_journey_read_only() -> Result<()> {
9797
assert_eq!(
9898
node_by_index(&app, app.state.entries[0].index),
9999
node_by_name(&app, fixture_str(long_root)),
100-
"it recomputes the cached entries"
100+
"it recomputes the cached items"
101101
);
102102
// when hitting the S key
103103
app.process_events(&mut terminal, into_codes("s"))?;
@@ -109,7 +109,7 @@ fn simple_user_journey_read_only() -> Result<()> {
109109
assert_eq!(
110110
node_by_index(&app, app.state.entries[1].index),
111111
node_by_name(&app, fixture_str(long_root)),
112-
"it recomputes the cached entries"
112+
"it recomputes the cached items"
113113
);
114114
// when hitting the S key again
115115
app.process_events(&mut terminal, into_codes("s"))?;
@@ -125,7 +125,7 @@ fn simple_user_journey_read_only() -> Result<()> {
125125
assert_eq!(
126126
node_by_index(&app, app.state.entries[0].index),
127127
node_by_name(&app, fixture_str(short_root)),
128-
"it recomputes the cached entries"
128+
"it recomputes the cached items"
129129
);
130130
}
131131

@@ -136,7 +136,7 @@ fn simple_user_journey_read_only() -> Result<()> {
136136
assert_eq!(
137137
node_by_name(&app, fixture_str(long_root)),
138138
node_by_index(&app, *app.state.navigation().selected.as_ref().unwrap()),
139-
"it moves the cursor down and selects the next entry based on the current sort mode"
139+
"it moves the cursor down and selects the next item based on the current sort mode"
140140
);
141141
// when hitting it while there is nowhere to go
142142
app.process_events(&mut terminal, into_codes("j"))?;
@@ -150,7 +150,7 @@ fn simple_user_journey_read_only() -> Result<()> {
150150
assert_eq!(
151151
node_by_name(&app, fixture_str(short_root)),
152152
node_by_index(&app, *app.state.navigation().selected.as_ref().unwrap()),
153-
"it moves the cursor up and selects the next entry based on the current sort mode"
153+
"it moves the cursor up and selects the next item based on the current sort mode"
154154
);
155155
// when hitting the k key again
156156
app.process_events(&mut terminal, into_codes("k"))?;
@@ -166,12 +166,12 @@ fn simple_user_journey_read_only() -> Result<()> {
166166
assert_eq!(
167167
new_root_idx,
168168
app.state.navigation().view_root,
169-
"it enters the entry if it is a directory, changing the root"
169+
"it enters the item if it is a directory, changing the root"
170170
);
171171
assert_eq!(
172172
index_by_name(&app, "dir"),
173173
*app.state.navigation().selected.as_ref().unwrap(),
174-
"it selects the first entry in the directory"
174+
"it selects the first item in the directory"
175175
);
176176

177177
// when hitting the u key while inside a sub-directory
@@ -185,7 +185,7 @@ fn simple_user_journey_read_only() -> Result<()> {
185185
assert_eq!(
186186
node_by_name(&app, fixture_str(short_root)),
187187
node_by_index(&app, *app.state.navigation().selected.as_ref().unwrap()),
188-
"changes the selection to the first item in the list of entries"
188+
"changes the selection to the first item in the list of items"
189189
);
190190
}
191191
}
@@ -255,14 +255,14 @@ fn simple_user_journey_read_only() -> Result<()> {
255255
assert_eq!(
256256
Some(1),
257257
app.window.mark_pane.as_ref().map(|p| p.marked().len()),
258-
"it toggled the previous selected entry off",
258+
"it toggled the previous selected item off",
259259
);
260260

261261
assert!(
262262
app.window.mark_pane.as_ref().map_or(false, |p| p
263263
.marked()
264264
.contains_key(&previously_selected_index)),
265-
"it leaves the first selected entry marked"
265+
"it leaves the first selected item marked"
266266
);
267267
}
268268
// when hitting the spacebar (after moving up to the first entry)

src/interactive/app/tests/journeys_with_writes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn basic_user_journey_with_deletion() -> Result<()> {
1818
assert_eq!(
1919
app.window.mark_pane.as_ref().map(|p| p.marked().len()),
2020
Some(4),
21-
"expecting 4 selected entries, the parent dir, and some children"
21+
"expecting 4 selected items, the parent dir, and some children"
2222
);
2323

2424
assert!(fixture.as_ref().is_dir(), "expecting fixture root to exist");
@@ -34,7 +34,7 @@ fn basic_user_journey_with_deletion() -> Result<()> {
3434
)?;
3535
assert!(
3636
app.window.mark_pane.is_none(),
37-
"the marker pane is gone as all entries have been removed"
37+
"the marker pane is gone as all items have been removed"
3838
);
3939
assert_eq!(
4040
app.state.navigation().selected,

src/interactive/widgets/footer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl Footer {
3737

3838
let spans = vec![
3939
Span::from(format!(
40-
"Sort mode: {} Total disk usage: {} Entries: {} {progress} ",
40+
"Sort mode: {} Total disk usage: {} Items: {} {progress} ",
4141
match sort_mode {
4242
SortMode::SizeAscending => "size ascending",
4343
SortMode::SizeDescending => "size descending",

src/interactive/widgets/help.rs

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -106,105 +106,109 @@ impl HelpPane {
106106
}
107107
};
108108

109-
title("Keys for pane control");
109+
title("Pane control");
110110
{
111111
hotkey(
112112
"q/<Esc>",
113-
"Close the current pane. Closes the program if no",
114-
Some("pane is open"),
113+
"Close the current pane.",
114+
Some("Closes the program if no pane is open."),
115115
);
116116
hotkey(
117117
"<Tab>",
118118
"Cycle between all open panes.",
119119
Some("Activate 'Marked Items' pane to delete selected files."),
120120
);
121-
hotkey("?", "Show or hide the help pane", None);
121+
hotkey("?", "Show or hide the help.", None);
122122
spacer();
123123
}
124-
title("Keys for Navigation");
124+
title("Navigation");
125125
{
126-
hotkey("j/<Down>", "move down an entry", None);
127-
hotkey("k/<Up>", "move up an entry", None);
128-
hotkey("o/l/<Enter>", "descent into the selected directory", None);
126+
hotkey("j/<Down>", "Move down.", None);
127+
hotkey("k/<Up>", "Move up.", None);
128+
hotkey("o/l/<Enter>", "Descent into the selected directory.", None);
129129
hotkey("<Right>", "^", None);
130130
hotkey(
131131
"u/h/<Left>",
132-
"ascent one level into the parent directory",
132+
"Ascent one level into the parent directory.",
133133
None,
134134
);
135135
hotkey("<Backspace>", "^", None);
136-
hotkey("Ctrl + d", "move down 10 entries at once", None);
136+
hotkey("Ctrl + d", "Move down 10 items.", None);
137137
hotkey("<Page Down>", "^", None);
138-
hotkey("Ctrl + u", "move up 10 entries at once", None);
138+
hotkey("Ctrl + u", "Move up 10 items.", None);
139139
hotkey("<Page Up>", "^", None);
140-
hotkey("H/<Home>", "Move to the top of the entries list", None);
141-
hotkey("G/<End>", "Move to the bottom of the entries list", None);
140+
hotkey("H/<Home>", "Move to the top of the list.", None);
141+
hotkey("G/<End>", "Move to the bottom of the list.", None);
142142
spacer();
143143
}
144-
title("Keys for display");
144+
title("Display");
145145
{
146-
hotkey("s", "toggle sort by size ascending/descending", None);
147-
hotkey("m", "toggle sort by mtime ascending/descending", None);
148-
hotkey("c", "toggle sort by items ascending/descending", None);
146+
hotkey("s", "Toggle sort by size descending/ascending.", None);
147+
hotkey(
148+
"m",
149+
"Toggle sort by modified time descending/ascending.",
150+
None,
151+
);
152+
hotkey("c", "Toggle sort by items descending/ascending.", None);
149153
hotkey(
150154
"g",
151-
"cycle through percentage display and bar options",
155+
"Cycle through percentage display and bar options.",
152156
None,
153157
);
154158
spacer();
155159
}
156-
title("Keys for entry operations");
160+
title("Open/Mark/Search");
157161
{
158162
hotkey(
159163
"Shift + o",
160-
"Open the entry with the associated program",
164+
"Open the item with the associated program.",
161165
None,
162166
);
163167
hotkey(
164168
"d",
165-
"Toggle the currently selected entry and move down",
169+
"Toggle the currently selected item and move down.",
166170
None,
167171
);
168172
hotkey(
169173
"x",
170-
"Mark the currently selected entry for deletion and move down",
174+
"Mark the currently selected item for deletion and move down.",
171175
None,
172176
);
173-
hotkey("<Space>", "Toggle the currently selected entry", None);
174-
hotkey("a", "Toggle all entries", None);
177+
hotkey("<Space>", "Toggle the currently selected item.", None);
178+
hotkey("a", "Toggle all items.", None);
175179
hotkey(
176180
"/",
177-
"Git-style glob search, case-insensitive, always from the top of the tree",
178-
None,
181+
"Git-style glob search, case-insensitive.",
182+
Some("Search starts from the current directory."),
179183
);
180184
spacer();
181185
}
182-
title("Keys in the Mark pane");
186+
title("Mark items pane");
183187
{
184188
hotkey(
185189
"x/d/<Space>",
186-
"Remove the selected entry from the list",
190+
"Remove the selected item from the list.",
187191
None,
188192
);
189-
hotkey("a", "Remove all entries from the list", None);
193+
hotkey("a", "Remove all items from the list.", None);
190194
hotkey(
191195
"Ctrl + r",
192-
"Permanently delete all marked entries without prompt!",
196+
"Permanently delete all marked items without prompt.",
193197
Some("This operation cannot be undone!"),
194198
);
195199
#[cfg(feature = "trash-move")]
196200
hotkey(
197201
"Ctrl + t",
198-
"Move all marked entries to the trash bin",
199-
Some("The entries can be restored from the trash bin"),
202+
"Move all marked items to the trash bin.",
203+
Some("The items can be restored from the trash bin."),
200204
);
201205
spacer();
202206
}
203-
title("Keys for application control");
207+
title("Application control");
204208
{
205209
hotkey(
206210
"Ctrl + c",
207-
"close the application. No questions asked!",
211+
"Close the application. No questions asked!",
208212
None,
209213
);
210214
spacer();

0 commit comments

Comments
 (0)