summaryrefslogtreecommitdiffstats
path: root/lib/template.php
diff options
context:
space:
mode:
authorCôme BERNIGAUD <come.bernigaud@laposte.net>2011-08-28 18:12:53 +0200
committerCôme BERNIGAUD <come.bernigaud@laposte.net>2011-08-28 23:11:45 +0200
commitb92603b3fdaef09a65088844d9dac9b06ef0a890 (patch)
tree2bcfe170dec6bf45732a37c93b02fd407b2fe283 /lib/template.php
parent281b2187abac07826c3231816d9d4746ae2c0e91 (diff)
downloadnextcloud-server-b92603b3fdaef09a65088844d9dac9b06ef0a890.tar.gz
nextcloud-server-b92603b3fdaef09a65088844d9dac9b06ef0a890.zip
Translation for date column
Diffstat (limited to 'lib/template.php')
-rw-r--r--lib/template.php21
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/template.php b/lib/template.php
index 79c9dc4bf11..adedd4f901a 100644
--- a/lib/template.php
+++ b/lib/template.php
@@ -76,6 +76,7 @@ function simple_file_size($bytes) {
}
function relative_modified_date($timestamp) {
+ $l=new OC_L10N('template');
$timediff = time() - $timestamp;
$diffminutes = round($timediff/60);
$diffhours = round($diffminutes/60);
@@ -83,18 +84,18 @@ function relative_modified_date($timestamp) {
$diffmonths = round($diffdays/31);
$diffyears = round($diffdays/365);
- if($timediff < 60) { return 'seconds ago'; }
- else if($timediff < 120) { return '1 minute ago'; }
- else if($timediff < 3600) { return $diffminutes.' minutes ago'; }
+ 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 '1 hour ago'; }
//else if($timediff < 86400) { return $diffhours.' hours ago'; }
- else if((date('G')-$diffhours) > 0) { return 'today'; }
- else if((date('G')-$diffhours) > -24) { return 'yesterday'; }
- else if($timediff < 2678400) { return $diffdays.' days ago'; }
- else if($timediff < 5184000) { return 'last month'; }
- else if((date('n')-$diffmonths) > 0) { return 'months ago'; }
- else if($timediff < 63113852) { return 'last year'; }
- else { return 'years ago'; }
+ 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 < 5184000) { return $l->t('last month'); }
+ else if((date('n')-$diffmonths) > 0) { return $l->t('months ago'); }
+ else if($timediff < 63113852) { return $l->t('last year'); }
+ else { return $l->t('years ago'); }
}