MCPcopy
hub / github.com/lingodotdev/lingo.dev / loadLocaleFromCookies

Function loadLocaleFromCookies

packages/react/src/rsc/utils.ts:40–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38 * ```
39 */
40export async function loadLocaleFromCookies() {
41 const requestCookies = await cookies();
42 const result = requestCookies.get(LOCALE_COOKIE_NAME)?.value || "en";
43 return result;
44}
45
46/**
47 * Sets the current locale in the `"lingo-locale"` cookie.

Callers 3

LingoHtmlComponentFunction · 0.90
utils.spec.tsFile · 0.90

Calls 1

getMethod · 0.65

Tested by

no test coverage detected