mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-27 17:31:09 -06:00
44 lines
681 B
PHP
44 lines
681 B
PHP
<?php
|
|
declare(strict_types = 1);
|
|
|
|
namespace FireflyIII\Support\Twig;
|
|
|
|
use Twig_Extension;
|
|
use Twig_SimpleFilter;
|
|
|
|
/**
|
|
*
|
|
* Class Budget
|
|
*
|
|
* @package FireflyIII\Support\Twig
|
|
*/
|
|
class Translation extends Twig_Extension
|
|
{
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getFilters(): array
|
|
{
|
|
$filters = [];
|
|
|
|
$filters[] = new Twig_SimpleFilter(
|
|
'_', function ($name) {
|
|
|
|
return trans('firefly.' . $name);
|
|
|
|
}, ['is_safe' => ['html']]
|
|
);
|
|
|
|
return $filters;
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
public function getName(): string
|
|
{
|
|
return 'FireflyIII\Support\Twig\Translation';
|
|
}
|
|
}
|