fixing date duration i18n

This commit is contained in:
Colin Kuskie 2008-11-14 23:54:15 +00:00
parent 0c2ca8184c
commit 47419b9602
3 changed files with 51 additions and 7 deletions

View file

@ -7,6 +7,7 @@
- fixed #9076: Thingy broken in latest beta, Save and Close buttons missing
from Add/Edit Field dialogs (SDH Consulting Group).
- fixed #4214: Missing i18n in asset manager
- fixed #8849: More missing i18n
7.6.3
- improved performance of file uploads

View file

@ -826,34 +826,35 @@ The number of seconds in the interval.
sub secondsToInterval {
my $self = shift;
my $seconds = shift;
my $i18n = WebGUI::International->new($self->session, 'WebGUI');
my ($interval, $units);
if ($seconds >= 31536000) {
$interval = round($seconds/31536000);
$units = "years";
$units = $i18n->get("years");
}
elsif ($seconds >= 2592000) {
$interval = round($seconds/2592000);
$units = "months";
$units = $i18n->get("months");
}
elsif ($seconds >= 604800) {
$interval = round($seconds/604800);
$units = "weeks";
$units = $i18n->get("weeks");
}
elsif ($seconds >= 86400) {
$interval = round($seconds/86400);
$units = "days";
$units = $i18n->get("days");
}
elsif ($seconds >= 3600) {
$interval = round($seconds/3600);
$units = "hours";
$units = $i18n->get("hours");
}
elsif ($seconds >= 60) {
$interval = round($seconds/60);
$units = "minutes";
$units = $i18n->get("minutes");
}
else {
$interval = $seconds;
$units = "seconds";
$units = $i18n->get("seconds");
}
return ($interval, $units);
}

View file

@ -4211,6 +4211,48 @@ Users may override this setting in their profile.
context => q{i18n label for YUI paginator},
},
'years' => {
message => q{years},
lastUpdated => 1226706547,
context => q{i18n label for time duration in WebGUI::DateTime},
},
'months' => {
message => q{months},
lastUpdated => 1226706547,
context => q{i18n label for time duration in WebGUI::DateTime},
},
'weeks' => {
message => q{weeks},
lastUpdated => 1226706547,
context => q{i18n label for time duration in WebGUI::DateTime},
},
'days' => {
message => q{days},
lastUpdated => 1226706547,
context => q{i18n label for time duration in WebGUI::DateTime},
},
'hours' => {
message => q{hours},
lastUpdated => 1226706547,
context => q{i18n label for time duration in WebGUI::DateTime},
},
'minutes' => {
message => q{minutes},
lastUpdated => 1226706547,
context => q{i18n label for time duration in WebGUI::DateTime},
},
'seconds' => {
message => q{seconds},
lastUpdated => 1226706547,
context => q{i18n label for time duration in WebGUI::DateTime},
},
};
1;