Skip to content

Commit

Permalink
Merge pull request #11452 from creative-commoners/pulls/5/tx-1730698793
Browse files Browse the repository at this point in the history
TLN Update translations
  • Loading branch information
GuySartorelli authored Nov 4, 2024
2 parents 8d5c4ac + 0b9a828 commit d110c9e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
20 changes: 20 additions & 0 deletions lang/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ en:
SilverStripe\Forms\GridField\GridFieldFilterHeader:
Search: 'Search "{name}"'
SearchFormFaliure: 'No search form could be generated'
Search_Default: Search
SilverStripe\Forms\GridField\GridFieldGroupDeleteAction:
UnlinkSelfFailure: 'Cannot remove yourself from this group, you will lose admin rights'
SilverStripe\Forms\GridField\GridFieldPaginator:
Expand Down Expand Up @@ -199,6 +200,25 @@ en:
YEARS_SHORT_PLURALS:
one: '{count} year'
other: '{count} years'
SilverStripe\ORM\FieldType\DBDatetime:
nDays:
one: 'one day'
other: '{count} days'
nHours:
one: 'one hour'
other: '{count} hours'
nMinutes:
one: 'one minute'
other: '{count} minutes'
nMonths:
one: 'one month'
other: '{count} months'
nSeconds:
one: 'one second'
other: '{count} seconds'
nYears:
one: 'one year'
other: '{count} years'
SilverStripe\ORM\FieldType\DBEnum:
ANY: Any
SilverStripe\ORM\FieldType\DBForeignKey:
Expand Down
17 changes: 7 additions & 10 deletions src/ORM/FieldType/DBDatetime.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,19 +242,16 @@ public static function getTimeBetween(DBDateTime $from, DBDateTime $to): string
['count' => $diff->i]
);
}
$message = _t(
__CLASS__ . '.nSeconds',
'one second|{count} seconds',
['count' => $diff->s ?? 0]
);
if ($diff->s) {
$result[] = _t(
__CLASS__ . '.nSeconds',
'one second|{count} seconds',
['count' => $diff->s]
);
$result[] = $message;
}
if (empty($result)) {
return _t(
__CLASS__ . '.nSeconds',
'{count} seconds',
['count' => 0]
);
return $message;
}
return implode(', ', $result);
}
Expand Down

0 comments on commit d110c9e

Please sign in to comment.