From 4583f5098d6fc2a0e312db14c60b1cc7acecb879 Mon Sep 17 00:00:00 2001 From: Tore Sinding Bekkedal Date: Wed, 20 Nov 2024 23:43:11 +0100 Subject: [PATCH] =?UTF-8?q?lager=20en=20const=20for=20dekorator-spr=C3=A5k?= =?UTF-8?q?-cookie-navn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/routing.ts | 3 ++- src/lib/constants.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/i18n/routing.ts b/src/i18n/routing.ts index d84ca34f0..ff91aada4 100644 --- a/src/i18n/routing.ts +++ b/src/i18n/routing.ts @@ -2,13 +2,14 @@ import {defineRouting} from "next-intl/routing"; import {createNavigation} from "next-intl/navigation"; import type {NextResponse} from "next/server"; import {DEFAULT_LANGUAGE as defaultLocale, SUPPORTED_LANGUAGES as locales} from "../lib/i18n/common"; +import {DECORATOR_LANG_COOKIE} from "../lib/constants.ts"; // Kopiert fra node_modules/next-intl/dist/types/src/routing/config.d.ts type CookieAttributes = Pick< NonNullable["2"]>, "maxAge" | "domain" | "partitioned" | "path" | "priority" | "sameSite" | "secure" | "name" >; -const localeCookie: CookieAttributes = {name: "decorator-language", path: "/"}; +const localeCookie: CookieAttributes = {name: DECORATOR_LANG_COOKIE, path: "/"}; export const routing = defineRouting({locales, defaultLocale, localeCookie, localePrefix: "as-needed"}); diff --git a/src/lib/constants.ts b/src/lib/constants.ts index ffb06edbf..a80a32676 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -2,6 +2,6 @@ export const BASE_PATH = "/sosialhjelp/soknad" as const; export const LINK_PAGE_PATH = `${BASE_PATH}/link` as const; export const ENABLE_DEBUG_I18N = false; -export const DIGISOS_LANGUAGE_STORAGE_KEY = "digisos-language" as const; +export const DECORATOR_LANG_COOKIE = "decorator-language" as const; export const XSRF_COOKIE_NAME = "XSRF-TOKEN-SOKNAD-API" as const; export const XSRF_HEADER_NAME = "X-XSRF-TOKEN" as const;