Skip to content

Commit

Permalink
fix: next-app
Browse files Browse the repository at this point in the history
  • Loading branch information
stepan662 committed Oct 25, 2024
1 parent fbe4a23 commit fc7efe8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions testapps/next-app/src/tolgee/language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export async function getLanguage() {
const locale = cookieStore.get(LANGUAGE_COOKIE)?.value;
if (locale && ALL_LANGUAGES.includes(locale)) {
return locale;
} else {
return (
detectLanguageFromHeaders(await headers(), ALL_LANGUAGES) ??
DEFAULT_LANGUAGE
);
}

// try to detect language from headers
const detected = detectLanguageFromHeaders(headers(), ALL_LANGUAGES);
// or use default
return detected || DEFAULT_LANGUAGE;
}

0 comments on commit fc7efe8

Please sign in to comment.