From d3d2d324d21c61ef0f2b7f30541a20d31c66b7b9 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sat, 21 Nov 2020 15:03:06 +0100 Subject: [PATCH] statusbar: properly pluralize the line+word+character count report This avoids poor wordings such as "Words: 1 Lines: 1 Chars: 1". Also, display the numbers in a more logical, ascending order: lines first, words second, characters third. This is what 'wc' uses, too. --- src/text.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/text.c b/src/text.c index 00570835..71bbbcf1 100644 --- a/src/text.c +++ b/src/text.c @@ -2987,9 +2987,12 @@ void do_wordlinechar_count(void) openfile->current = was_current; openfile->current_x = was_x; - /* Display the total word, line, and character counts on the status bar. */ - statusline(HUSH, _("%sWords: %zu Lines: %zd Chars: %zu"), openfile->mark ? - _("In Selection: ") : "", words, lines, chars); + /* Report on the status bar the number of lines, words, and characters. */ + statusline(HUSH, _("%s%zd %s, %zu %s, %zu %s"), + openfile->mark ? _("In Selection: ") : "", + lines, P_("line", "lines", lines), + words, P_("word", "words", words), + chars, P_("character", "characters", chars)); } #endif /* !NANO_TINY */