* * 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:----Md7iUU3HFwfMDMTNN5v5WyEhzJWOviydZe/W2wKhw2vgjS05Zaa+0cDUN1FFUNbHTIPCo0EO5DcP9lifsXkX88/JGD3Ky8wf7/MqJ+OzWdRikXoadnA5TYASyB6Mo0JvgF/gHEW3aardCv9MPdRHNTjsMIFr4+jrQ243m9EbUCRfHCeFbyHo+NN/PG99dx/aIlS8sCj4/Ik/hVXLUKlaCmnETQZF4zwxwRO12nBt0jZiA8MtULWannrgBG9rf0riPNTXrK1ZcQA1ha0HGfue2Mw1HXsW2hLaPKFtiOPmnCaMLzsK2dAXADxuRYUe2MiOAJy4Ox36F7ZP10e/3awClN1PQxIO8mfk5a8dyoZAIUffdPnxuu23ubb091vMlKld8Wepkttos/r9kIdq72VzP9U/hlIR9GLavvimouRjbYuq4lCO4hFpmStKzwEmLgm/U0Y44SywglNM90kC3IAJQjcPEyPeEwZkEWS3cm7wtTcebLFLBInfq6/AygOvTc/nM2MyJjQC0tVZVqLYZA3Zi2bCvCkcVxeRiyZvQLMxN5N+hW6mHZRjrJUAgzKdZPRQhLV2MRRJEnBaCNx8DutuXSLfajfp4SF8C5tnC8j4r3e+zUaWbEcgJnyMsUJkRpXydyXRsjTCFy6yZWvLRg+jHWQaodBWZtqZ7gBOyDeIDn4=----ATTACHMENT:----NTQxMzc5MTU4ODkyMDY1NyA2OTEzOTgwMjY2NDgxODAyIDQ5NzIwNzEwNjE5NjkzNzU=