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

Default locale not working #1520

Open
Mecanik opened this issue Jun 9, 2024 · 4 comments
Open

Default locale not working #1520

Mecanik opened this issue Jun 9, 2024 · 4 comments

Comments

@Mecanik
Copy link

Mecanik commented Jun 9, 2024

Hello,

I cloned the project several times and tested over and over, it seems that the default locale (en) is not applied with there is no locale specified. This is very bad and will cause a lot off 404's and other issues; shouldn't RedirectToPreferredLocaleSubscriber do this by default? Or what is the correct solution for this?

Please advise, thanks.

@Mecanik
Copy link
Author

Mecanik commented Jun 18, 2024

Anyone please?

@xabbuh
Copy link
Member

xabbuh commented Jun 18, 2024

it seems that the default locale (en) is not applied with there is no locale specified

I am not sure I understand what you mean with that. Can you please provide some details that will allows us to understand what exactly you are doing and what you expected to happen?

@Mecanik
Copy link
Author

Mecanik commented Jun 18, 2024

it seems that the default locale (en) is not applied with there is no locale specified

I am not sure I understand what you mean with that. Can you please provide some details that will allows us to understand what exactly you are doing and what you expected to happen?

Sure. I copied everything in terms of how the localisation is setup in this demo, into a new 7.1 project. It "works", but not as it should (or I imagine it should work).

For example, I go to:

website.com/ - this will trigger the default Symfony 7 page, although I have a DefaultController.

But if I go to:

website.com/en/ - this will trigger my DefaultController.

The exact same thing happens for other controllers, for example ThingController.

If I go to:

website.com/thing/new/ - this will trigger: No route found for "GET http://.../ads"

But if I go to:

website.com/en/thing/new - this will trigger ThingController.

So the default locale is not being set when there is no locale specified, this is my main issue. The configuration is copied exactly as in this project.

If this is the default behaviour; it's not good; it should add the default locale when one is not specified and redirect.

If this is not the default behaviour; it means I have an issue somewhere and I would appreciate some directions.

Thanks

@xabbuh
Copy link
Member

xabbuh commented Jun 18, 2024

Well, if we are talking about your own application (even if some of its code is borrowed from the demo application), please use on of the Symfony support channels (Slack or StackOverflow). If you experience an issue with the demo itself, we will need more information.

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