Skip to content
Snippets Groups Projects
Commit eae50e0d authored by Jaime Pérez's avatar Jaime Pérez
Browse files

Refactor translation methods for PHP's implementation of Gettext.

parent b2820c7b
No related branches found
No related tags found
No related merge requests found
...@@ -469,7 +469,7 @@ class Translate ...@@ -469,7 +469,7 @@ class Translate
} }
public static function translateSingular($original) public static function translateSingularPHPGettext($original)
{ {
$text = \Gettext\BaseTranslator::$current->gettext($original); $text = \Gettext\BaseTranslator::$current->gettext($original);
...@@ -483,7 +483,7 @@ class Translate ...@@ -483,7 +483,7 @@ class Translate
} }
public static function translatePlural($original, $plural, $value) public static function translatePluralPHPGettext($original, $plural, $value)
{ {
$text = \Gettext\BaseTranslator::$current->ngettext($original, $plural, $value); $text = \Gettext\BaseTranslator::$current->ngettext($original, $plural, $value);
......
...@@ -174,8 +174,11 @@ class SimpleSAML_XHTML_Template ...@@ -174,8 +174,11 @@ class SimpleSAML_XHTML_Template
// set up translation // set up translation
if ($this->localization->i18nBackend === 'gettext/gettext') { if ($this->localization->i18nBackend === 'gettext/gettext') {
$options['translation_function'] = array('\SimpleSAML\Locale\Translate', 'translateSingular'); $options['translation_function'] = array('\SimpleSAML\Locale\Translate', 'translateSingularPHPGettext');
$options['translation_function_plural'] = array('\SimpleSAML\Locale\Translate', 'translatePlural'); $options['translation_function_plural'] = array(
'\SimpleSAML\Locale\Translate',
'translatePluralPHPGettext'
);
} // TODO: add a branch for the old SimpleSAMLphp backend } // TODO: add a branch for the old SimpleSAMLphp backend
$twig = new Twig_Environment($loader, $options); $twig = new Twig_Environment($loader, $options);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment