import "server-only"; import { headers } from "next/headers"; import { cache } from "react"; import { pickLocale, t, type Locale } from "./index"; export const getLocale = cache(async (): Promise => pickLocale((await headers()).get("x-locale"))); export async function getT() { const locale = await getLocale(); return { locale, t: t(locale) }; }