Re: [PATCH v4 05/14] i18n: add--interactive: mark plural strings
- From
Vasco Almeida <vascomalmeida@sapo.pt>
- Date
- Oct 20, 2016, 16:29 UTC
- Message-ID
- <1476980984.14459.14.camel@sapo.pt>
- In-Reply-To
- <xmqqtwc8kwqz.fsf@gitster.mtv.corp.google.com>
A Qua, 19-10-2016 às 11:40 -0700, Junio C Hamano escreveu:
Show 36 quoted lines
> Vasco Almeida <vascomalmeida@sapo.pt> writes:
>
> >
> > @@ -669,12 +669,18 @@ sub status_cmd {
> > sub say_n_paths {
> > my $did = shift @_;
> > my $cnt = scalar @_;
> > - print "$did ";
> > - if (1 < $cnt) {
> > - print "$cnt paths\n";
> > - }
> > - else {
> > - print "one path\n";
> > + if ($did eq 'added') {
> > + printf(__n("added %d path\n", "added %d paths\n",
> > + $cnt), $cnt);
> > + } elsif ($did eq 'updated') {
> > + printf(__n("updated %d path\n", "updated %d
> > paths\n",
> > + $cnt), $cnt);
> > + } elsif ($did eq 'reverted') {
> > + printf(__n("reverted %d path\n", "reverted %d
> > paths\n",
> > + $cnt), $cnt);
> > + } else {
> > + printf(__n("touched %d path\n", "touched %d
> > paths\n",
> > + $cnt), $cnt);
> > }
> > }
>
> Nice to see you covered all verbs currently in use and then
> future-proofed by adding a fallback "touched" here.
>
> Thanks.
> Thanks. Here I added %d to the singular sentences "added %d path\n" to avoid a Perl warning about a redundant argument in printf.