mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-07 06:33:57 -06:00
58859eb35a
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
42 lines
635 B
PHP
42 lines
635 B
PHP
<?php
|
|
|
|
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()
|
|
{
|
|
$filters = [];
|
|
|
|
$filters[] = new Twig_SimpleFilter(
|
|
'_', function($name) {
|
|
|
|
return trans('firefly.' . $name);
|
|
|
|
}, ['is_safe' => ['html']]
|
|
);
|
|
|
|
return $filters;
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
public function getName()
|
|
{
|
|
return 'FireflyIII\Support\Twig\Translation';
|
|
}
|
|
}
|