storyblok-nuxt icon indicating copy to clipboard operation
storyblok-nuxt copied to clipboard

language slug in path & weird behaviour when switching language

Open lukas-a-brand opened this issue 3 years ago • 3 comments

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

lukas-a-brand avatar May 04 '21 14:05 lukas-a-brand

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 😄

ademarCardoso avatar May 20 '21 19:05 ademarCardoso

@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 ;)

lukas-a-brand avatar May 20 '21 20:05 lukas-a-brand

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 😄

ademarCardoso avatar May 21 '21 12:05 ademarCardoso

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

alvarosabu avatar Apr 28 '23 07:04 alvarosabu