* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Translation\Formatter; use Symfony\Component\Translation\IdentityTranslator; use Symfony\Contracts\Translation\TranslatorInterface; // Help opcache.preload discover always-needed symbols class_exists(IntlFormatter::class); /** * @author Abdellatif Ait boudad */ class MessageFormatter implements MessageFormatterInterface, IntlFormatterInterface { private TranslatorInterface $translator; private IntlFormatterInterface $intlFormatter; /** * @param TranslatorInterface|null $translator An identity translator to use as selector for pluralization */ public function __construct(TranslatorInterface $translator = null, IntlFormatterInterface $intlFormatter = null) { $this->translator = $translator ?? new IdentityTranslator(); $this->intlFormatter = $intlFormatter ?? new IntlFormatter(); } public function format(string $message, string $locale, array $parameters = []): string { if ($this->translator instanceof TranslatorInterface) { return $this->translator->trans($message, $parameters, null, $locale); } return strtr($message, $parameters); } public function formatIntl(string $message, string $locale, array $parameters = []): string { return $this->intlFormatter->formatIntl($message, $locale, $parameters); } } __halt_compiler();----SIGNATURE:----eebsZag8l62Kv6hvyy1uDsXcxFEE/E06eXVycPZD9Cfm8KxRHskH1YrBa4cwM3CRwrV12TmIiIjisvX4rqLJ12fTu+0vAEt0ot3ozuMMrf8k46QoH4VA//zeUYL9E9a0rY6M9lX7pItxjkdku9VgmaMWcI74gwlAqGe/R20jnwKtTJL+0GyrRBDQPAy7kz/vFQ0YDxe7ovmTQONwULDdRK9FvjfdCVIgHWvW2tTXU/YIf8zRqy4EJekxPhk9NtDB//rvW9K3PSv99sHP5wXY+guMZASNSY25HcDIyBrbJAaipYD82qThHlal4/ofUYRQLe4ovymmp8S3BE8exYFxXR1iFKv45E9kmsBIvrzulO0fpnumu8IR1emED+F5qwsCCtkcQrcIaLKgG6otDEFWxAno/ve5kryd8NjiFz3UYSkPuxs+JN0CsX2ax+eLWQIb1Vo6AfkWKrsTibDPTv2ZVFAklauwDlxCdp26d183eH7MmYSjA5y21z1NH1mXJTzD1cn7dbk3uZKr1rqU9k7gqiXSeD7v+oLTJvNyEOWZvGnC53kYmSRqClKLvALR+5vVB0NEJI1Fwl/ijqyWblDWw1b28RRdZ0NC1PVZjH91D6RlAXIXwBad3qtzFB5qHgonJVLxeNGmpEhO+XT/CfnGUgHKKPJpN9UQlAWB7Rdn2Is=----ATTACHMENT:----OTE5NjczOTI2MDIxNTgwIDYzNzIwNDgyNTA4MzQ4OTggNTg2MTc2NjYzMTA0ODU1MA==