diff --git a/inlang/source-code/paraglide/paraglide-next/src/app/middleware/detection/CookieDetection.ts b/inlang/source-code/paraglide/paraglide-next/src/app/middleware/detection/CookieDetection.ts index b6fc572c76..d3cc333eec 100644 --- a/inlang/source-code/paraglide/paraglide-next/src/app/middleware/detection/CookieDetection.ts +++ b/inlang/source-code/paraglide/paraglide-next/src/app/middleware/detection/CookieDetection.ts @@ -4,7 +4,7 @@ import { LANG_COOKIE } from "../../constants" export const createCookieDetection = (cfg: { availableLanguageTags: readonly T[] }): LanguageDetector => (request) => { - const localeCookeValue = request.cookies.get(LANG_COOKIE.name)?.value - if (cfg.availableLanguageTags.includes(localeCookeValue as T)) return localeCookeValue as T + const localeCookieValue = request.cookies.get(LANG_COOKIE.name)?.value + if (cfg.availableLanguageTags.includes(localeCookieValue as T)) return localeCookieValue as T else return undefined } diff --git a/inlang/source-code/paraglide/paraglide-next/src/app/middleware/index.ts b/inlang/source-code/paraglide/paraglide-next/src/app/middleware/index.ts index 1b4b4591da..b62dd9b471 100644 --- a/inlang/source-code/paraglide/paraglide-next/src/app/middleware/index.ts +++ b/inlang/source-code/paraglide/paraglide-next/src/app/middleware/index.ts @@ -52,7 +52,7 @@ export function Middleware(opt: MiddlewareOptions) { * https://nextjs.org/docs/pages/building-your-application/routing/middleware#setting-headers */ return function middleware(request: NextRequest) { - const localeCookeValue = request.cookies.get(LANG_COOKIE.name)?.value + const localeCookieValue = request.cookies.get(LANG_COOKIE.name)?.value const locale = resolveLanguage(request, sourceLanguageTag, [ opt.strategy.resolveLocale, createCookieDetection({ availableLanguageTags: availableLanguageTags }), @@ -64,7 +64,7 @@ export function Middleware(opt: MiddlewareOptions) { const localisedURL = opt.strategy.getLocalisedUrl(canonicalPath, locale, false) const localeCookieMatches = - isAvailableLanguageTag(localeCookeValue) && localeCookeValue === locale + isAvailableLanguageTag(localeCookieValue) && localeCookieValue === locale const headers = new Headers(request.headers) headers.set(PARAGLIDE_LANGUAGE_HEADER_NAME, locale)