[TWIG][I18N] Remove unnecessary wrappers for translation functions, use them directly

This commit is contained in:
Hugo Sales 2022-03-01 17:25:51 +00:00
parent 90f9378bca
commit 5600218924
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
2 changed files with 2 additions and 14 deletions

View File

@ -79,8 +79,8 @@ class Extension extends AbstractExtension
new TwigFunction('open_details', [Runtime::class, 'openDetails']),
new TwigFunction('show_stylesheets', [Runtime::class, 'getShowStylesheets']),
new TwigFunction('add_right_panel_block', [Runtime::class, 'addRightPanelBlock']),
new TwigFunction('trans', [Runtime::class, 'trans']),
new TwigFunction('trans_list', [Runtime::class, 'transList']),
new TwigFunction('trans', '\App\Core\I18n\_m'),
new TwigFunction('trans_list', '\App\Core\I18n\_m_list'),
];
}
}

View File

@ -33,8 +33,6 @@ declare(strict_types = 1);
namespace App\Twig;
use App\Core\Event;
use function App\Core\I18n\_m;
use function App\Core\I18n\_m_list;
use App\Core\Router\Router;
use App\Entity\Actor;
use App\Entity\Feed;
@ -58,16 +56,6 @@ class Runtime implements RuntimeExtensionInterface, EventSubscriberInterface
$this->request = $req;
}
public function trans(array $message, array $arguments): string
{
return _m($message, $arguments);
}
public function transList(array $elements): string
{
return _m_list($elements);
}
public function isCurrentRouteActive(string ...$routes): string
{
return $this->isCurrentRoute('active', ...$routes);