[Koha-cvs] CVS: koha/misc/translator TmplTokenizer.pm,1.13,1.14
Ambrose C. LI
acli at users.sourceforge.net
Fri Feb 20 05:38:05 CET 2004
Update of /cvsroot/koha/koha/misc/translator
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18383
Modified Files:
TmplTokenizer.pm
Log Message:
Support %0.0s notation so that we can omit the %s as in Year%s for the
Chinese translation. (This won't work for all languages; ultimately the
English templates must be fixed.)
Index: TmplTokenizer.pm
===================================================================
RCS file: /cvsroot/koha/koha/misc/translator/TmplTokenizer.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** TmplTokenizer.pm 20 Feb 2004 02:48:39 -0000 1.13
--- TmplTokenizer.pm 20 Feb 2004 04:38:02 -0000 1.14
***************
*** 546,554 ****
$fmt = $';
$it .= '%';
! } elsif ($fmt =~ /^%(?:(\d+)\$)?s/) {
$n += 1;
! my $i = (defined $1? $1: $n) - 1;
$fmt = $';
! $it .= $params[$i]
} elsif ($fmt =~ /^%[^%a-zA-Z]*[a-zA-Z]/) {
$fmt = $';
--- 546,560 ----
$fmt = $';
$it .= '%';
! } elsif ($fmt =~ /^%(?:(\d+)\$)?(?:(\d+)(?:\.(\d+))?)?s/) {
$n += 1;
! my($i, $width, $prec) = ((defined $1? $1: $n), $2, $3);
$fmt = $';
! if (!defined $width && !defined $prec) {
! $it .= $params[$i]
! } elsif (defined $width && defined $prec && !$width && !$prec) {
! ;
! } else {
! die "Unsupported precision specification in format: $&\n"; #XXX
! }
} elsif ($fmt =~ /^%[^%a-zA-Z]*[a-zA-Z]/) {
$fmt = $';
More information about the Koha-cvs
mailing list