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

dialect()->translate() doesn't work on controllers #40

Open
ivanlucci1 opened this issue Jun 15, 2021 · 1 comment
Open

dialect()->translate() doesn't work on controllers #40

ivanlucci1 opened this issue Jun 15, 2021 · 1 comment

Comments

@ivanlucci1
Copy link

ivanlucci1 commented Jun 15, 2021

I'm switching the languages on my site via controllers (a select element on a form that calls a POST route/controller when language is selected), but when I use dialect()->translate() in my controller, to translate the current route and redirect the user to the translated route, it always returns my current POST route that is reading my request to switch the language, not the translated route that it should return.

And if I use dialect()->redirectUrl() it returns the URL not parsed and doens't translate de route to the selected language, as its described on your documentation.

What should I do? The only solution would be switching languagues without using controllers? The dialect()->translate() function works perfectly outside controllers.

Thank you.

@ivanlucci1
Copy link
Author

Hello, the solution I found for this was switching languages with a list of translated links from dialect()->translate() on the front-end, rather than switching languages using controllers.

@pmochine pmochine reopened this Apr 11, 2022
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

2 participants