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

getNonLocalizedURL not working as expected #820

Open
Yinci opened this issue Mar 3, 2022 · 0 comments
Open

getNonLocalizedURL not working as expected #820

Yinci opened this issue Mar 3, 2022 · 0 comments
Assignees
Labels

Comments

@Yinci
Copy link

Yinci commented Mar 3, 2022

Describe the bug
When using getNonLocalizedURL, the returned URL is not properly not localized.

To Reproduce
locale in config/app.php is nl (default).

  1. Example URI: /nl/dit-is-een-url
    Applying this URI returns /nl/dit-is-een-url
  2. Example URI: /en/this-is-a-url
    Applying this URI returns /nl/dit-is-een-url
  3. Example URI: /dit-is-een-url (enabling hideDefaultLocaleInURL)
    Applying this URI returns /dit-is-een-url
  4. Example URI: /this-is-a-url (enabling hideDefaultLocaleInURL)
    Applying this URI returns /dit-is-een-url

Expected behavior
I'd expect to get the given/current URL without a locale prefix. However, this is only ever the case if the current locale is the default and the default is hidden.

So, per given examples, i'd expect:

  1. /dit-is-een-url
  2. /this-is-a-url
  3. /dit-is-een-url
  4. /this-is-a-url

More info:

  • Version of Laravel: 7.30.4
  • Version of the Laravel-localization package: 1.6.1
  • Which middleware is used in Route::groups: 'localeSessionRedirect', 'localizationRedirect'
@iwasherefirst2 iwasherefirst2 self-assigned this Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants