You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
614 B
31 lines
614 B
<?php
|
|
|
|
/*
|
|
* This file is part of Twig.
|
|
*
|
|
* (c) 2010-2019 Fabien Potencier
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Twig\Extensions;
|
|
|
|
use Twig\Extension\AbstractExtension;
|
|
use Twig\Extensions\TokenParser\TransTokenParser;
|
|
use Twig\TwigFilter;
|
|
|
|
class I18nExtension extends AbstractExtension
|
|
{
|
|
public function getTokenParsers()
|
|
{
|
|
return [new TransTokenParser()];
|
|
}
|
|
|
|
public function getFilters()
|
|
{
|
|
return [
|
|
new TwigFilter('trans', 'gettext'),
|
|
];
|
|
}
|
|
}
|
|
|