From: Reis Radomil Date: Tue, 22 May 2018 14:16:12 +0000 (+0000) Subject: recvattach.c: Fix plural message "Print tagged attachments?" X-Git-Tag: neomutt-20180622~38^2~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7787ec5af1c8480afe38be38437403804aa6a56b;p=neomutt recvattach.c: Fix plural message "Print tagged attachments?" If messages are tagged, then count them and use the number to pluralise the phrase "tagged messages" correctly. --- diff --git a/recvattach.c b/recvattach.c index 2943c2381..2d0e5d6c2 100644 --- a/recvattach.c +++ b/recvattach.c @@ -836,10 +836,23 @@ static void print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, void mutt_print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, struct Body *top) { + char prompt[SHORT_STRING]; struct State state = { 0 }; + int tagmsgcount = 0; - if (query_quadoption(Print, tag ? _("Print tagged attachment(s)?") : - _("Print attachment?")) != MUTT_YES) + if (tag) + for (int i = 0; i < actx->idxlen; i++) + if (actx->idx[i]->content->tagged) + tagmsgcount++; + + snprintf(prompt, sizeof(prompt), + /* L10N: Although we now the precise number of tagged messages, we + do not show it to the user. So feel free to use a "generic + plural" as plural translation if your language has one. */ + tag ? ngettext("Print tagged attachment?", "Print %d tagged attachments?", tagmsgcount) : + _("Print attachment?"), + tagmsgcount); + if (query_quadoption(Print, prompt) != MUTT_YES) return; if (!AttachSplit)