Re: [PATCH/WIP] git-svn: tweak log format to match "svn log" output

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

 



On Sun, Jul 25, 2010 at 08:40:57AM +0000, Eric Wong wrote:
> Jonathan Nieder <jrnieder@xxxxxxxxx> wrote:
> > diff --git i/git-svn.perl w/git-svn.perl
> > index 5252722..75e7165 100755
> > --- i/git-svn.perl
> > +++ w/git-svn.perl
> > @@ -5644,8 +5644,8 @@ sub show_commit_normal {
> >  
> >  	if ($can_localize) {
> >  		my $d = Locale::gettext->domain("subversion");
> > -		$sing_fmt = $d->nget($sing_fmt, $plur_fmt, 1);
> > -		$plur_fmt = $d->nget($sing_fmt, $plur_fmt, 10);
> > +		$sing_fmt = $d->get($sing_fmt);
> > +		$plur_fmt = $d->get($plur_fmt);
> >  	}
> >  	if (my $l = $c->{l}) {
> >  		while ($l->[$#$l] eq "\n" && $#$l > 0
> 
> Thanks Jonathan, that looks much better.  I'll squash that on top
> Jens' first patch.

No, this is still wrong, we have to use $d->nget as some languages can have
multiple plural forms. Russian e.g. has two: one if the last digit ends with
2-4 and a second one if it ends with 5-9. Exact rule:
"Plural-Forms:  nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 &&
n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"

That's why it's wrong to use $plur_fmt at all (and also "10" from above
makes no sense). Let's use:
$d->nget(" | %d line", " | %d lines", $nr_line), $nr_line)
where $nr_line is the variable.

Sorry for not providing a patch now but I need more time ... I suggest one
of you try it again and I check it :-)

Jens
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]