Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callback to return custom string on MissingTranslationEvent #66

Open
tomaszkane opened this issue Sep 7, 2022 · 1 comment
Open

Callback to return custom string on MissingTranslationEvent #66

tomaszkane opened this issue Sep 7, 2022 · 1 comment
Labels
type:enhancement Enhancement

Comments

@tomaszkane
Copy link

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.

Telegram conversation

Additional info

Q A
Version 1.0.2
PHP version 8.0
Operating system KDE Neon
@samdark
Copy link
Member

samdark commented Sep 7, 2022

Could be achieved by using result of dispatch() method that returns modified event with the message to format.

@samdark samdark added the type:enhancement Enhancement label Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Enhancement
Projects
None yet
Development

No branches or pull requests

2 participants