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

Add instruction about adding SetLocaleFromUrlSegment to $middlewarePriority in README #22

Open
pgrenaud opened this issue Feb 1, 2021 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@pgrenaud
Copy link
Contributor

pgrenaud commented Feb 1, 2021

Add instruction about defining $middlewarePriority in App\Http\Kernel and adding \Exolnet\Translation\Http\Middleware\SetLocaleFromUrlSegment::class to the top of the list (or as closest to the top as possible).

Without that, some part of the app experience wont be translated properly. For instance, if the Authenticate middleware redirect an unauthenticated user to the login page, the user will always end up on the login page in the default language (usually English) even if they were attempting to reach a translated URL.

Therefore, the SetLocaleFromUrlSegment middleware must come before the Authenticate middleware. SetLocaleFromUrlSegment should be at the top of the list, unless you have a specific reason to do otherwise.

@pgrenaud pgrenaud added bug Something isn't working enhancement New feature or request labels Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant