helper = $translatableStringHelper; } /** * Returns a list of filters to add to the existing list. * * (non-PHPdoc) * * @see Twig_Extension::getFilters() */ public function getFilters() { return [ new TwigFilter( 'localize_translatable_string', [$this, 'localize'] ), ]; } /** * Returns the name of the extension. * * @return The name of the extension. */ public function getName() { return 'chill_main_localize'; } public function localize(array $translatableStrings) { return $this->helper ->localize($translatableStrings); } }