Commit 37a1c3a0 authored by Robbie Averill's avatar Robbie Averill

FIX Add localisation to FilterDescription terms

parent dcc1bbb3
......@@ -248,6 +248,8 @@ class DatedUpdateHolder_Controller extends Page_Controller {
/**
* Returns a description of the current filter
*
* @return string
*/
public function FilterDescription() {
$params = $this->parseParams();
......@@ -256,7 +258,7 @@ class DatedUpdateHolder_Controller extends Page_Controller {
if ($params['tag']) {
$term = TaxonomyTerm::get_by_id('TaxonomyTerm', $params['tag']);
if ($term) {
$filters[] = 'within "' . $term->Name . '"';
$filters[] = _t('DatedUpdateHolder.FILTER_WITHIN', 'within') . ' "' . $term->Name . '"';
}
}
......@@ -265,19 +267,20 @@ class DatedUpdateHolder_Controller extends Page_Controller {
$from = strtotime($params['from']);
if ($params['to']) {
$to = strtotime($params['to']);
$filters[] = 'between ' . date('j/m/Y', $from) . ' and ' . date('j/m/Y', $to);
$filters[] = _t('DatedUpdateHolder.FILTER_BETWEEN', 'between') . ' '
. date('j/m/Y', $from) . ' and ' . date('j/m/Y', $to);
} else {
$filters[] = 'on ' . date('j/m/Y', $from);
$filters[] = _t('DatedUpdateHolder.FILTER_ON', 'on') . ' ' . date('j/m/Y', $from);
}
} else {
$to = strtotime($params['to']);
$filters[] = 'on ' . date('j/m/Y', $to);
$filters[] = _t('DatedUpdateHolder.FILTER_ON', 'on') . ' ' . date('j/m/Y', $to);
}
}
if ($params['year'] && $params['month']) {
$timestamp = mktime(1, 1, 1, $params['month'], 1, $params['year']);
$filters[] = 'in ' . date('F', $timestamp) . ' ' . $params['year'];
$filters[] = _t('DatedUpdateHolder.FILTER_IN', 'in') . ' ' . date('F', $timestamp) . ' ' . $params['year'];
}
if ($filters) {
......
......@@ -85,6 +85,10 @@ en:
DESCRIPTION: 'Generic content page'
PLURALNAME: 'Dated Update Holders'
SINGULARNAME: 'Dated Update Holder'
FILTER_WITHIN: 'within'
FILTER_BETWEEN: 'between'
FILTER_ON: 'on'
FILTER_IN: 'in'
DatedUpdatePage:
DESCRIPTION: 'Generic content page'
PLURALNAME: 'Dated Update Pages'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment