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

Routes in Hebrew (Reload Page Not Working) #969

Closed
1 task done
AliAbuArab opened this issue Nov 23, 2020 · 13 comments
Closed
1 task done

Routes in Hebrew (Reload Page Not Working) #969

AliAbuArab opened this issue Nov 23, 2020 · 13 comments

Comments

@AliAbuArab
Copy link

Version

nuxt-i18n: 6.15.4
nuxt: 2.14.7

Nuxt configuration

mode:

  • universal

Nuxt-i18n configuration

i18n: {
locales: [{
code: 'he',
iso: 'he'
}
],
defaultLocale: 'he',
parsePages: false,
strategy: 'prefix',
pages: {
'categories/index': {
he: '/קטגוריות'
},
'categories/_id': {
he: '/קטגוריות/:id'
},
search: {
he: '/חיפוש'
}
}
}


The problem is when i reload the page it gives me Page Not Found. 
because the routes in Hebrew, when i change the "he" values to be in english it works fine.
I think the none ascii characters make the problem 
@rchl
Copy link
Collaborator

rchl commented Nov 23, 2020

Try:

    pages: {
      about: {
        en: "/about",
        he: encodeURI("/קטגוריות")
      }
    }

The encodeURI part should be the fix for your issue. VueRouter even complains about it in the console if you don't use it so that should have been a hint.

As for adding about to the list also, I think this might be a bug in the module. It seems to be using he value if en is not specified. And if you are not using en at all then you can of course skip it.

@rchl rchl added question❓ and removed bug 🐛 labels Nov 23, 2020
@AliAbuArab
Copy link
Author

Screen Shot 2020-11-25 at 11 17 03
Screen Shot 2020-11-25 at 11 17 27

We still have the same issue.
When we load the index page and then routing to /categoties or /search it working fine also in hebrew there is no problem
But if we reload the page at hebrew locale it gives us "This page could not be found"
If we reload the page at english locale it works fine.
so for example:
http://localhost:3000/en/categories => working
http://localhost:3000/he/קטגוריות => not working on refresh page

@rchl
Copy link
Collaborator

rchl commented Nov 25, 2020

Why don't you provide a repro project and instead you are trying to make me reproduce your issue from screenshots? :)

@AliAbuArab
Copy link
Author

You are correct brother, this is the best method.
https://github.com/AliAbuArab/nuxti18n-test.git

@rchl
Copy link
Collaborator

rchl commented Nov 25, 2020

OK, I see that there is a problem but I'm not sure if it's related to this module as you can also reproduce some weird issues by just creating a page like קטגוריות.vue and disabling this module completely. Then reloading such page kinda works on SSR but then everything disappears on the client.

@AliAbuArab
Copy link
Author

Yes we can change the directories name just to be in hebrew, but we want this app to support mainly three languages (hebrew, arabic and english).

@rchl
Copy link
Collaborator

rchl commented Nov 25, 2020

What I'm saying is that the issue is likely in Nuxt or VueRouter since it reproduces without this module also.

@AliAbuArab
Copy link
Author

got it.
thank you so much my friend, i will check that with VueRouter team.

@lucifez385
Copy link

@AliAbuArab
add "vue-router": "3.4.6" in package.json
it work for me.

@rchl
Copy link
Collaborator

rchl commented Nov 27, 2020

I can confirm that v3.4.9 doesn't work while v3.4.8 does.
@posva Is this a known issue?

@rchl
Copy link
Collaborator

rchl commented Nov 27, 2020

So 3.4.9 includes this change vuejs/vue-router#3350 which seems to be intentionally breaking some cases.

I personally don't think it's OK to introduce breaking changes in a patch release...

@pi0 It seems like you are aware of this change and I suppose the issue mentioned in #969 (comment) will be fixed in the next Nuxt release?

@pi0
Copy link

pi0 commented Nov 28, 2020

@rchl Indeed. Current workaround is that we pinned vue-router but still looking for a proper anti-regression :) nuxt/nuxt#8325

@stale
Copy link

stale bot commented Jan 30, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 30, 2021
@stale stale bot closed this as completed Feb 7, 2021
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

4 participants