🐛 fix(locale): Default value

This commit is contained in:
web@ppanel
2024-11-16 14:46:09 +07:00
parent a0bb101126
commit 937408fc57
6 changed files with 8 additions and 12 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ export function getLocale() {
const defaultLocale = locales.includes(browserLocale) ? browserLocale : '';
const cookies = new Cookies(null, { path: '/' });
const cookieLocale = cookies.get('locale') || '';
const locale = cookieLocale || defaultLocale || NEXT_PUBLIC_DEFAULT_LANGUAGE || locales[0];
const locale = cookieLocale || defaultLocale || NEXT_PUBLIC_DEFAULT_LANGUAGE;
return locale;
}