In the Vue based frontend (vue-demo-store), language selection/switching does not seem to work. How to reproduce:
Clone the Frontends Repository, install it and run pnpm run dev --filter=vue-demo-store as described in the README.md. Visit „localhost:3000“ in the browser.
There is a language switcher in the footer: a select box with the options „English“, „Polish“ and „German“, as expected.
If you change the selected language, nothing happens.
If you enter one of these URLs in the browser address bar and hit „Enter“, you get the 404 error page („We can’t find what you are looking for. Are you lost?“):
localhost:3000/de-De/Summer-trends-DE/
localhost:3000/Summer-trends-DE/
localhost:3000/de-De/
localhost:3000/de
All SEO URLs I could retrieve through demo-frontends.shopware.store/store-api/seo-url had the same languageId (don’t know if this is relevant).
My question: What would one have to do to get a language switcher that actually switches the language?
Thank you very much for checking that! If I am not mistaken, the content at the link you posted is rendered by PHP/Twig/… and not by Vue/Nuxt/… There everything works flawlessly.
I can now switch between English and Polish (I don’t know what happened earlier… might be a mistake on my part).
German still does not work for me ([localhost:3000] /de-De → 404). Do you currently see the same behavior?
Variant selection currently does not work in Polish (for me, e.g. at [localhost:3000] /pl-PL/Curry-Madras-indyjskie-sezonowane/SW10100 , observe the change in the URL in the browser address bar)
The html lang="..." attribute does not reflect the selected language.
The „Landing page“ link in the footer does not work in Polish.
The sorting dropdown appears empty on [localhost:3000] /pl-PL/Cooking-pleasure-Provence/Eat/
Switching the language using the language switcher always leads the user to the home page in the target language (works but is not as nice as the PHP based frontend).
Where I was stuck initially: We had based the sales channel configuration on the tutorial at „Shopware 6 - Tutorials - Setting up the Store for a bilinguale country“. There only the language code is appended to the URL, not the country code (e.g. ".../fr" not ".../fr-CH"). The Shopware Frontends Vue Demo Store seems to be set up under a different assumption. Once I realized that this (inconsistent Frontend / Sales Channel configuration) was the main problem, it could easily be dealt with.
In our project, I had to fix/„fix“ the things mentioned above as well. This is done now. I might not have a problem anymore. Do you know of other localization pitfalls?
Activating multi-language support has taken me longer than I expected. Do you believe, the Shopware Frontends team would appreciate an issue / feature request on the Github issue tracker?