diff options
Diffstat (limited to 'lib/template/functions.php')
-rw-r--r-- | lib/template/functions.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/template/functions.php b/lib/template/functions.php index 2d43cae1c0c..717e197c1cb 100644 --- a/lib/template/functions.php +++ b/lib/template/functions.php @@ -78,15 +78,13 @@ function relative_modified_date($timestamp) { $diffmonths = round($diffdays/31); if($timediff < 60) { return $l->t('seconds ago'); } - else if($timediff < 120) { return $l->t('1 minute ago'); } - else if($timediff < 3600) { return $l->t('%d minutes ago', $diffminutes); } - else if($timediff < 7200) { return $l->t('1 hour ago'); } - else if($timediff < 86400) { return $l->t('%d hours ago', $diffhours); } + else if($timediff < 3600) { return $l->n('%n minute ago', '%n minutes ago', $diffminutes); } + else if($timediff < 86400) { return $l->n('%n hour ago', '%n hours ago', $diffhours); } else if((date('G')-$diffhours) > 0) { return $l->t('today'); } else if((date('G')-$diffhours) > -24) { return $l->t('yesterday'); } - else if($timediff < 2678400) { return $l->t('%d days ago', $diffdays); } + else if($timediff < 2678400) { return $l->n('%n day go', '%n days ago', $diffdays); } else if($timediff < 5184000) { return $l->t('last month'); } - else if((date('n')-$diffmonths) > 0) { return $l->t('%d months ago', $diffmonths); } + else if((date('n')-$diffmonths) > 0) { return $l->n('%n month ago', '%n months ago', $diffmonths); } else if($timediff < 63113852) { return $l->t('last year'); } else { return $l->t('years ago'); } } |