Add context to 'Select' translation strings
This commit is contained in:
@@ -24,6 +24,7 @@ class I18n extends \Twig_Extension {
|
||||
'localize' => 'localize',
|
||||
'__' => 'translate',
|
||||
'_n' => 'pluralize',
|
||||
'_x' => 'translateWithContext',
|
||||
'date' => 'date'
|
||||
);
|
||||
|
||||
@@ -63,6 +64,12 @@ class I18n extends \Twig_Extension {
|
||||
return call_user_func_array('_n', $this->setTextDomain($args));
|
||||
}
|
||||
|
||||
function translateWithContext() {
|
||||
$args = func_get_args();
|
||||
|
||||
return call_user_func_array('_x', $this->setTextDomain($args));
|
||||
}
|
||||
|
||||
function date() {
|
||||
$args = func_get_args();
|
||||
$date = (isset($args[0])) ? $args[0] : null;
|
||||
@@ -88,4 +95,4 @@ class I18n extends \Twig_Extension {
|
||||
}
|
||||
return $args;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user