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

nuxt/i18n custom route paths doesn't work #2923

Open
Gizem346 opened this issue Apr 18, 2024 · 2 comments
Open

nuxt/i18n custom route paths doesn't work #2923

Gizem346 opened this issue Apr 18, 2024 · 2 comments

Comments

@Gizem346
Copy link

Environment

My nuxt and i18n version are:
"@nuxtjs/i18n": "^8.3.0",
"nuxt": "^3.10.1"

Reproduction

It's my github repo: https://github.com/Gizem346/i18n-testing
and stackblitz reproduction link is here : https://stackblitz.com/~/github.com/Gizem346/i18n-testing

Describe the bug

Current locale is: en
When i change language as deutch, also i want to change url path as de/uber-uns and de/kontaktiere-uns but it doesn't.
When I manually type the address de/uber-uns into the search bar, I can access the page, but not when I change it via links.
Here is nuxt/i18n custom route paths documantation: https://i18n.nuxtjs.org/docs/guide/custom-paths

What is Expected?

  • de/uber-uns
  • de/kontaktiere-uns

What is actually happening?

  • de/about-us
  • de/contact-us

Additional context

No response

Logs

No response

@BobbieGoede
Copy link
Collaborator

Your stackblitz reproduction doesn't seem to work for me (I haven't checked your repo repro locally yet either) but I think the issue here is that you're configuring custom routes for about and not for about-us.

My guess is that changing the configuration to the following should make things work as expected:

    pages: {
      'about-us': {
        en: '/about-us',
        de: '/uber-uns'
      }
    },

@Gizem346
Copy link
Author

First of all, thank you for your contribution. @BobbieGoede
Yes, when I updated it as you said, I saw that the url changed depending on the link I clicked. Thanks a lot.
Expected: de/uber-uns
Happened: de/uber-uns

But before, when I manually typed de/uber-uns in the search bar, I could see the "Uber Uns" page in RouterView. Now I can't see the relevant pages even though the router has changed.

ss-of-vue-dev-tool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants