Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

standaniels
Copy link

In some cases the hideDefaultLocaleInURL isn't a static value and reading the config wouldn't suffice. For example:

  • Domain example.nl
    • Has locales:
      • nl
    • Default locale: nl
    • Hide default locale: true
  • Domain example.be
    • Has locales:
      • fr
      • nl
    • Default locale: fr
    • Hide default locale: false

This PR extracts the logic to determine whether the request should be redirected to the (non-) localized URL or not to a method on the base middleware class, so a user could write their own middleware, but are able to extend the package middleware; they only need to overwrite the shouldRedirectToLocalizedUrl and shouldRedirectToNonLocalizedUrl methods.

What do you think?

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

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.