Skip to content

Commit

Permalink
fix(i18n): console.log for locale
Browse files Browse the repository at this point in the history
  • Loading branch information
emendelski committed Oct 21, 2024
1 parent 3db2f81 commit 0cae392
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/services/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,19 @@ export async function startClient(initialLocale) {
export function getInitialLocale() {
let locale = getCookie("locale");
// no cookie, let's get the first accepted language

if (!locale) {
locale = languageFromLocale(
getLocaleFromNavigator() || INIT_OPTIONS.fallbackLocale
);
}

console.log('locale', {
cookie: getCookie("locale"),
navigator: getLocaleFromNavigator(),
fallback: INIT_OPTIONS.fallbackLocale,
locale,
});

return locale;
}

0 comments on commit 0cae392

Please sign in to comment.