vuestorefront/vue-storefront

Adding `no_prefix` to the i18n object in nuxt.config doesn't work

Closed this issue · 2 comments

The no_prefix strategy for the nuxt-i18n module doesn't work. Currently, if the no_prefix strategy is set in i18n options in nuxt.config.js each time you change the language on the server side you get redirected, e.g. when on home page and switching language you get redirected to /de, even though this page doesn't exist as this strategy removes all off the route prefixes.

Changing the language in the case of the no_prefix strategy should only result in changing the locale and the locale and currency cookies.

Yes this happens when you use prefix_and_default or prefix_except_default, that is because i18nRedirectsUtil.getTargetLocale method tries to find locale at the path and if not checks the cookie locale which is 'en' as default. And overrides that. It should look at the strategy and order the priority list by that

image

Issue is closed. Reason: Too Old (>6 months)


Sergii Kirianov

Developer Advocate

Vue Storefront