import { Messages } from "@lingui/core"; import * as React$1 from "react"; import * as react_jsx_runtime0 from "react/jsx-runtime"; //#region src/locales/useLocale.d.ts /** * Get the current locale and a function to switch locales. * Loads the new catalog dynamically and sets a cookie for server-side persistence. */ declare function useLocale(): { locale: string; setLocale: (code: string) => void; }; //#endregion //#region src/locales/LocaleDirectionProvider.d.ts interface LocaleDirectionProviderProps { children: React$1.ReactNode; } /** * Wraps the app with DirectionProvider and keeps it in sync with the current locale. * Automatically updates direction when locale changes via useLocale. */ declare function LocaleDirectionProvider({ children }: LocaleDirectionProviderProps): react_jsx_runtime0.JSX.Element; //#endregion //#region src/locales/loadMessages.d.ts declare function loadMessages(locale: string): Promise; //#endregion //#region src/locales/locales.d.ts /** * Canonical locale definitions -- the single source of truth. * * This file is intentionally free of Vite/Astro APIs (`import.meta.env` etc.) * so it can be imported from CLI tools (Lingui, Lunaria) running in plain Node. * * To add a new locale: * 1. Add an entry here (with `enabled: false`). * 2. Run `pnpm locale:extract` to generate the PO file. * 3. Translate the strings in the PO file. * 4. Set `enabled: true` once coverage is sufficient. * * Lingui and Lunaria use all locales (for extraction and tracking). * The admin runtime only exposes locales with `enabled: true`. */ interface LocaleDefinition { /** BCP 47 locale code (e.g. "en", "pt-BR"). */ code: string; /** Human-readable label in the locale's own language. */ label: string; /** Whether this locale is selectable in the admin UI. */ enabled: boolean; /** Text direction for this locale. Defaults to "ltr" if not specified. */ dir?: "rtl" | "ltr"; } //#endregion //#region src/locales/config.d.ts /** Available locales at runtime, validated against BCP 47. */ declare const SUPPORTED_LOCALES: LocaleDefinition[]; declare const SUPPORTED_LOCALE_CODES: Set; declare const DEFAULT_LOCALE: string; /** Get a display label for a locale code, falling back to uppercase code. */ declare function getLocaleLabel(code: string): string; /** Get the text direction for a locale code. Defaults to "ltr" if not specified. */ declare function getLocaleDir(code: string): "ltr" | "rtl"; /** * Resolve the admin locale from a Request. * Priority: emdash-locale cookie -> Accept-Language -> DEFAULT_LOCALE. */ declare function resolveLocale(request: Request): string; //#endregion export { getLocaleLabel as a, loadMessages as c, getLocaleDir as i, LocaleDirectionProvider as l, SUPPORTED_LOCALES as n, resolveLocale as o, SUPPORTED_LOCALE_CODES as r, LocaleDefinition as s, DEFAULT_LOCALE as t, useLocale as u }; //# sourceMappingURL=config-BAgt8Ary.d.ts.map