SPB Git
355 B · 7 lines typescript
1import "server-only";2import { headers } from "next/headers";3import { cache } from "react";4import { pickLocale, t, type Locale } from "./index";5export const getLocale = cache(async (): Promise<Locale> => pickLocale((await headers()).get("x-locale")));6export async function getT() { const locale = await getLocale(); return { locale, t: t(locale) }; }7
Files · ba542514eac709a3e76ac3b3f88404c61356d594
Menu

Theme