aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Page.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@dracos.co.uk>2011-02-17 10:00:44 +0000
committerMatthew Somerville <matthew@dracos.co.uk>2011-02-17 10:00:44 +0000
commit77e3828c87267a0f894fa7cbcee850f3340b0771 (patch)
treedece8fa5fdc2019466a43f134e0f742beec214c1 /perllib/Page.pm
parent3033514eec2a30d43797c42eeb175fa9da9aeef1 (diff)
Some translation updates and i18n code improvements.
Diffstat (limited to 'perllib/Page.pm')
-rw-r--r--perllib/Page.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/perllib/Page.pm b/perllib/Page.pm
index 308d2a5c6..6acf53c14 100644
--- a/perllib/Page.pm
+++ b/perllib/Page.pm
@@ -507,17 +507,17 @@ sub prettify_duration {
return _('less than a minute') if $s == 0;
}
my @out = ();
- _part(\$s, 60*60*24*7, _('week'), \@out);
- _part(\$s, 60*60*24, _('day'), \@out);
- _part(\$s, 60*60, _('hour'), \@out);
- _part(\$s, 60, _('minute'), \@out);
+ _part(\$s, 60*60*24*7, _('%d week'), _('%d weeks'), \@out);
+ _part(\$s, 60*60*24, _('%d day'), _('%d days'), \@out);
+ _part(\$s, 60*60, _('%d hour'), _('%d hours'), \@out);
+ _part(\$s, 60, _('%d minute'), _('%d minutes'), \@out);
return join(', ', @out);
}
sub _part {
- my ($s, $m, $w, $o) = @_;
+ my ($s, $m, $w1, $w2, $o) = @_;
if ($$s >= $m) {
my $i = int($$s / $m);
- push @$o, "$i $w" . ($i != 1 ? 's' : '');
+ push @$o, sprintf(mySociety::Locale::nget($w1, $w2, $i), $i);
$$s -= $i * $m;
}
}