mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
translate phrases in getPeriodOfTime()
This commit is contained in:
parent
1b79a422e1
commit
f70973e80d
|
@ -53,19 +53,19 @@ function getPeriodOfTime($timestamp) { /* {{{ */
|
|||
$time = time() - $timestamp; // to get the time since that moment
|
||||
$time = ($time<1)? 1 : $time;
|
||||
$tokens = array (
|
||||
31536000 => getMLText('abbr_year'),
|
||||
2592000 => getMLText('abbr_month'),
|
||||
604800 => getMLText('abbr_week'),
|
||||
86400 => getMLText('abbr_day'),
|
||||
3600 => getMLText('abbr_hour'),
|
||||
60 => getMLText('abbr_minute'),
|
||||
1 => getMLText('abbr_second')
|
||||
31536000 => 'abbr_year',
|
||||
2592000 => 'abbr_month',
|
||||
604800 => 'abbr_week',
|
||||
86400 => 'abbr_day',
|
||||
3600 => 'abbr_hour',
|
||||
60 => 'abbr_minute',
|
||||
1 => 'abbr_second'
|
||||
);
|
||||
|
||||
foreach ($tokens as $unit => $text) {
|
||||
if ($time < $unit) continue;
|
||||
$numberOfUnits = floor($time / $unit);
|
||||
return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':'');
|
||||
return $numberOfUnits.' '.(($numberOfUnits>1) ? getMLText($text):getMLText($text));
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user