diff --git a/core/model/fieldtypes/Date.php b/core/model/fieldtypes/Date.php index b6cea7f10..e672d31dd 100644 --- a/core/model/fieldtypes/Date.php +++ b/core/model/fieldtypes/Date.php @@ -95,10 +95,27 @@ class Date extends DBField { */ function Ago() { if($this->value) { - if(time() < strtotime($this->value)) $agoWord = _t("Date.AWAY", " away"); - else $agoWord = _t("Date.AGO", " ago"); - - return $this->TimeDiff() . ' ' . $agoWord; + if(time() > strtotime($this->value)) { + return sprintf( + _t( + 'Date.TIMEDIFFAGO', + "%s ago", + PR_MEDIUM, + 'Natural language time difference, e.g. 2 hours ago' + ), + $this->TimeDiff() + ); + } else { + return sprintf( + _t( + 'Date.TIMEDIFFAWAY', + "%s away", + PR_MEDIUM, + 'Natural language time difference, e.g. 2 hours away' + ), + $this->TimeDiff() + ); + } } } diff --git a/lang/en_US.php b/lang/en_US.php index 492096214..2933a3bea 100644 --- a/lang/en_US.php +++ b/lang/en_US.php @@ -126,8 +126,6 @@ $lang['en_US']['DataObject']['SINGULARNAME'] = array( 50, 'Singular name of the object, used in dropdowns and to generally identify a single object in the interface' ); -$lang['en_US']['Date']['AGO'] = ' ago'; -$lang['en_US']['Date']['AWAY'] = ' away'; $lang['en_US']['Date']['DAY'] = ' day'; $lang['en_US']['Date']['DAYS'] = ' days'; $lang['en_US']['Date']['HOUR'] = ' hour'; @@ -138,6 +136,16 @@ $lang['en_US']['Date']['MONTH'] = ' month'; $lang['en_US']['Date']['MONTHS'] = ' months'; $lang['en_US']['Date']['SEC'] = ' sec'; $lang['en_US']['Date']['SECS'] = ' secs'; +$lang['en_US']['Date']['TIMEDIFFAGO'] = array( + '%s ago', + PR_MEDIUM, + 'Natural language time difference, e.g. 2 hours ago' +); +$lang['en_US']['Date']['TIMEDIFFAWAY'] = array( + '%s away', + PR_MEDIUM, + 'Natural language time difference, e.g. 2 hours away' +); $lang['en_US']['Date']['YEAR'] = ' year'; $lang['en_US']['Date']['YEARS'] = ' years'; $lang['en_US']['DateField']['NOTSET'] = 'not set';