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

LocaleProvider should respect LocaleSwitcher #748

Open
jontjs opened this issue Dec 7, 2023 · 0 comments
Open

LocaleProvider should respect LocaleSwitcher #748

jontjs opened this issue Dec 7, 2023 · 0 comments

Comments

@jontjs
Copy link

jontjs commented Dec 7, 2023

Since Symfony 6.1, it has been possible to run a portion of code in a specific locale, and as of Symfony 6.4 to render emails in a specific locale, but the LocaleProvider doesn't seem to respect either of these.

My situation is that I am using the Translatable extension on an e-commerce website, and need to send order-confirmation emails that use the localized names of the entities. When I use either of the new Symfony features, my email template as a whole DOES see use the locale specified. However when I rely on this bundle's proxyCurrentLocaleTranslation() method to translate a translatable entity's property in the template, the locale used is en rather than the one I specified (en_GB or de_DE). On digging through the code, I think this stems from the LocaleProvider's provideCurrentLocale() method

regards,
Jon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant