storyblok / storyblok-nuxt

Storyblok Nuxt module
https://www.storyblok.com/tp/nuxt-js-multilanguage-website-tutorial
MIT License
278 stars 44 forks source link

language slug in path & weird behaviour when switching language #48

Closed lukas-a-brand closed 1 year ago

lukas-a-brand commented 3 years ago

Hey, after updating to version 2.0.1 I stumbled upon a few problems, which also lack documentation and I am not quite certain if some of it is intended.

seems like paths that include a language slug seem to not work anymore... or at least return a 404

e.g.: "https://api.storyblok.com/v2/cdn/stories/en/about"

searched through the docs and played around a bit and you can give a language parameter to the request right....

although that is kind of a breaking change in general as it would then change the way you request pages...

e.g.: "https://api.storyblok.com/v2/cdn/stories/about?language=en" or "https://api.storyblok.com/v2/cdn/stories/ueber-uns?language=default"

<--- is that intended? Some backward compatibility would not hurt there, even if the language param way is also fine :)

What stops me from using it in production right now is some weird behaviour with some requests though.

Lets say I am on the german version ( default language ) of a page ... like "https://api.storyblok.com/v2/cdn/stories/ueber-uns?language=default"

everything is fine at first - if I stay in the same language all is good.

If I then change the language to the english version like "https://api.storyblok.com/v2/cdn/stories/about?language=en" then somehow the bridge seems to freak out and make a lot of requests till my app throws errors / dies. :)

https://user-images.githubusercontent.com/24302245/117017004-8dbdf900-acf3-11eb-964d-adead48a2457.mov

ademarCardoso commented 3 years ago

Hi my friend @lukas-a-brand thanks to send this isssue.

Have you checked the documentation on internationalization? I believe that this behavior occurs because we have changed the way you will get the languages. Check this link please. If the problem still occurs call me πŸ˜„

lukas-a-brand commented 3 years ago

@ademarCardoso well... the stuff I wrote above conforms exactly to the mentioned way of using it in the link you supplied https://www.storyblok.com/docs/guide/in-depth/internationalization#api-and-data-structure :)

Or did you refer to something else?

Can you please give me a shout on discord to discuss the problem, or let me know how to best test and solve it any way you want ;)

ademarCardoso commented 3 years ago

Can you show me the resquest error message ?, so I know what is failing If you want to call me on Discord, you will find me as @Ademar on the storyblok channel πŸ˜„

alvarosabu commented 1 year ago

Closed due to inactivity. Feel free to re-open it if needed. Thanks