mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-04-14 00:43:49 +00:00
36 lines
800 B
PHP
36 lines
800 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/*
|
|
* Chill is a software for social workers
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Chill\MainBundle\Templating;
|
|
|
|
class TranslatableStringTwig
|
|
{
|
|
/**
|
|
* TranslatableStringTwig constructor.
|
|
*/
|
|
public function __construct(private readonly TranslatableStringHelper $helper) {}
|
|
|
|
/**
|
|
* Returns the name of the extension.
|
|
*/
|
|
public function getName(): string
|
|
{
|
|
return 'chill_main_localize';
|
|
}
|
|
|
|
#[\Twig\Attribute\AsTwigFilter('localize_translatable_string')]
|
|
public function localize(array $translatableStrings): ?string
|
|
{
|
|
return $this->helper
|
|
->localize($translatableStrings);
|
|
}
|
|
}
|