move language config to i18n/request

This commit is contained in:
peintnermax
2024-10-11 11:16:34 +02:00
parent f87c2311a0
commit 76bb714e3a
3 changed files with 30 additions and 36 deletions

View File

@@ -1,5 +1,6 @@
"use server";
import { LANGUAGE_COOKIE_NAME } from "@/i18n/request";
import { cookies } from "next/headers";
export type Cookie = {
@@ -30,7 +31,7 @@ export async function setLanguageCookie(language: string) {
const cookiesList = cookies();
await cookiesList.set({
name: "NEXT_LOCALE",
name: LANGUAGE_COOKIE_NAME,
value: language,
httpOnly: true,
path: "/",