translator
translator copied to clipboard
Callback to return custom string on MissingTranslationEvent
What steps will reproduce the problem?
$thisMessageIdNotExist = 'xyz';
echo $translator->translate($thisMessageIdIsNotExist);
What do you get?
xyz
What do you want to get?
Oh no, "xyz" is not translated yet!
When event MissingTranslationEvent was triggered I want to return result of my callback not messageId string or fallbackLocale result.
Additional info
| Q | A |
|---|---|
| Version | 1.0.2 |
| PHP version | 8.0 |
| Operating system | KDE Neon |
Could be achieved by using result of dispatch() method that returns modified event with the message to format.