Skip to content

Commit 83c4747

Browse files
authored
fix: autochange language SSR (vuestorefront#6633)
1 parent e384e3f commit 83c4747

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
description: 'Fix for for disabling cookie generation on server side with `autoChangeCookie` option disabled',
3+
link: '',
4+
isBreaking: false,
5+
breakingChanges: [],
6+
author: 'Alef Barbeli',
7+
linkToGitHubAccount: 'https://github.com/alefbarbeli'
8+
};

packages/core/nuxt-module/lib/plugins/i18n-cookies.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ const i18nCookiesPlugin = ({ $cookies, i18n, app, redirect }) => {
4343

4444
if (isServer) {
4545
app.i18n.cookieValues = {
46-
[cookieNames.locale]: targetLocale,
47-
[cookieNames.currency]: getCurrencyByLocale(targetLocale)
46+
...(autoChangeCookie.locale && { [cookieNames.locale]: targetLocale }),
47+
...(autoChangeCookie.currency && { [cookieNames.currency]: getCurrencyByLocale(targetLocale) })
4848
};
4949

5050
if (redirectPath) {

0 commit comments

Comments
 (0)