coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] rm: Add number of arguments to interactive prompt


From: Eric Blake
Subject: Re: [PATCH] rm: Add number of arguments to interactive prompt
Date: Fri, 19 Jul 2013 06:35:30 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7

On 07/19/2013 06:14 AM, Bernhard Voelker wrote:

>> +++ b/src/rm.c
>> @@ -339,9 +339,13 @@ main (int argc, char **argv)
>>      {
>>        fprintf (stderr,
>>                 (x.recursive
>> -                ? _("%s: remove all arguments recursively? ")
>> -                : _("%s: remove all arguments? ")),
>> -               program_name);
>> +                ? ngettext ("%s: remove %zu argument recursively? ",
>> +                            "%s: remove %zu arguments recursively? ",
>> +                            select_plural (n_files))
>> +                : ngettext ("%s: remove %zu argument? ",
>> +                            "%s: remove %zu arguments? ",
>> +                            select_plural (n_files))),
> 
> The select_plural() call is not needed in the latter case
> because we are in this if-clause:
> 
>  if (prompt_once && (x.recursive || 3 < n_files))
> 
> i.e. it can not happen with 1 single file.
> 

Actually, it is still needed.  Just because the singular English form
will never be reached because n_files != 1, does not mean that there
will never be a translation to another language where select_plural will
still want to to choose an alternate form (for example, I seem to recall
the gettext manual talking about languages where 100 is treated
differently than 111).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]