* * 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:----Z7/R34k/a0YzUwm1Z5eAvMnO2ABRN7lW1cw0ioQ3wYg+Y54ow6MByh560WChUsICzeNR+Ze6nxrOAKSqknH11YSa+8SfWm120Qu06GM57g6YQby3CjjR0CFlunrMVPWF3SxzA2p+eKanirJIgSb9gwgGmw0WMzVzNotfsOe5vyqptfnBDxizGFFBMsgW7Ofsy+u41wI1mqHlH8pjhbNJHxpGLNiPPBCFE8KQo1NpjrkgpX6m7qHDgMCrS3HGznasQR+FHdNW4ANixBJCHj/2jXk4i7DiJ1mEzXRJcoyRTlO1vwLcLgIkvU6um8AQ1sUh5f3rDrQiRESwxSPtAEu7fzect/C9ZZjwIyagoTLHjzKLupzwdiyhdayW7sHtK73ziZwZUX3F7coXg/U5wqhUdw8XiiortQ/uUTfDVER03l8hBgrSHF+Q3N6ZagytWrGai96SyTFQLOy4QPv+y2ecwbVntgzLP+JZqduvI7QLOUTWDSnBPJwC4mgLzukzO8jYfY/Bi4KGSWes8lRu1Wd6DZx/142zDGftX/f7mpb5f72SKqxTmw1PNs1MHN+wZtmtyfQk2GzRjD8FRChXdpxnr2ktxo777k+zrIVyokki5ND70UeIPWOAP0haQbajmxUQOIzQaZsY0pbYey07RyXeOVtt8ifCi8+yS4H5N8woPxA=----ATTACHMENT:----NTU1NjA2MTg4MjIxOTMyOSAzMTQ3OTUwMDg2NTAwMzEzIDQzNzk3MjczMTMzMzQzMQ==