[TWIG][I18N] Add transList function, which uses _m_list
This commit is contained in:
parent
f73e9c12ba
commit
070f53c10e
|
@ -80,6 +80,7 @@ class Extension extends AbstractExtension
|
||||||
new TwigFunction('show_stylesheets', [Runtime::class, 'getShowStylesheets']),
|
new TwigFunction('show_stylesheets', [Runtime::class, 'getShowStylesheets']),
|
||||||
new TwigFunction('add_right_panel_block', [Runtime::class, 'addRightPanelBlock']),
|
new TwigFunction('add_right_panel_block', [Runtime::class, 'addRightPanelBlock']),
|
||||||
new TwigFunction('trans', [Runtime::class, 'trans']),
|
new TwigFunction('trans', [Runtime::class, 'trans']),
|
||||||
|
new TwigFunction('trans_list', [Runtime::class, 'transList']),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ namespace App\Twig;
|
||||||
|
|
||||||
use App\Core\Event;
|
use App\Core\Event;
|
||||||
use function App\Core\I18n\_m;
|
use function App\Core\I18n\_m;
|
||||||
|
use function App\Core\I18n\_m_list;
|
||||||
use App\Core\Router\Router;
|
use App\Core\Router\Router;
|
||||||
use App\Entity\Actor;
|
use App\Entity\Actor;
|
||||||
use App\Entity\Feed;
|
use App\Entity\Feed;
|
||||||
|
@ -62,6 +63,11 @@ class Runtime implements RuntimeExtensionInterface, EventSubscriberInterface
|
||||||
return _m($message, $arguments);
|
return _m($message, $arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function transList(array $elements): string
|
||||||
|
{
|
||||||
|
return _m_list($elements);
|
||||||
|
}
|
||||||
|
|
||||||
public function isCurrentRouteActive(string ...$routes): string
|
public function isCurrentRouteActive(string ...$routes): string
|
||||||
{
|
{
|
||||||
return $this->isCurrentRoute('active', ...$routes);
|
return $this->isCurrentRoute('active', ...$routes);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user