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.)
This commit is contained in:
parent
e9f1656fc1
commit
b6c37e376e
1 changed files with 9 additions and 3 deletions
|
@ -545,11 +545,17 @@ sub parametrize ($@) {
|
|||
} elsif ($fmt =~ /^%%/) {
|
||||
$fmt = $';
|
||||
$it .= '%';
|
||||
} elsif ($fmt =~ /^%(?:(\d+)\$)?s/) {
|
||||
} elsif ($fmt =~ /^%(?:(\d+)\$)?(?:(\d+)(?:\.(\d+))?)?s/) {
|
||||
$n += 1;
|
||||
my $i = (defined $1? $1: $n) - 1;
|
||||
my($i, $width, $prec) = ((defined $1? $1: $n), $2, $3);
|
||||
$fmt = $';
|
||||
$it .= $params[$i]
|
||||
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 = $';
|
||||
$it .= $&;
|
||||
|
|
Loading…
Reference in a new issue