mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
15 lines
348 B
TypeScript
15 lines
348 B
TypeScript
"use server";
|
|
|
|
import getEnv from "@/lib/env-entry";
|
|
import { cookies } from "next/headers";
|
|
|
|
const COOKIE_NAME = "NEXT_LOCALE";
|
|
|
|
export async function getUserLocale() {
|
|
return cookies().get(COOKIE_NAME)?.value || (getEnv("DefaultLocale") ?? "en");
|
|
}
|
|
|
|
export async function setUserLocale(locale: string) {
|
|
cookies().set(COOKIE_NAME, locale);
|
|
}
|