Skip to content

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