Skip to content

Commit 94d0402

Browse files
committed
compose: s/attachments/attachment when # is 1
Don't print plural `s` when there's only one attachment. Signed-off-by: Manos Pitsidianakis <[email protected]>
1 parent 632a1db commit 94d0402

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

meli/src/mail/compose.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,12 @@ To: {}
870870
);
871871
} else {
872872
grid.write_string(
873-
&format!("{} attachments [edit: {}]", attachments_no, edit_shortcut),
873+
&format!(
874+
"{} attachment{} [edit: {}]",
875+
attachments_no,
876+
if attachments_no != 1 { "s" } else { "" },
877+
edit_shortcut
878+
),
874879
theme_default.fg,
875880
if self.cursor == Cursor::Attachments {
876881
crate::conf::value(context, "highlight").bg

meli/src/mail/compose/edit_attachments.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl Component for EditAttachmentsRefMut<'_, '_> {
126126
grid.clear_area(area, theme_default);
127127
if attachments_no == 0 {
128128
grid.write_string(
129-
"no attachments",
129+
"No attachments",
130130
theme_default.fg,
131131
theme_default.bg,
132132
theme_default.attrs,
@@ -136,7 +136,11 @@ impl Component for EditAttachmentsRefMut<'_, '_> {
136136
);
137137
} else {
138138
grid.write_string(
139-
&format!("{} attachments ", attachments_no),
139+
&format!(
140+
"{} attachment{} ",
141+
attachments_no,
142+
if attachments_no == 1 { "" } else { "s" }
143+
),
140144
theme_default.fg,
141145
theme_default.bg,
142146
theme_default.attrs,

0 commit comments

Comments
 (0)