@firecms/core
Version:
Awesome Firebase/Firestore-based headless open-source CMS
34 lines (33 loc) • 1.23 kB
TypeScript
import { PropsWithChildren } from "react";
import { FireCMSTranslations } from "../types/translations";
export declare const FIRECMS_LOCALE_STORAGE_KEY = "firecms_locale";
/** DeepPartial helper — allows partial overrides at any nesting level */
type DeepPartial<T> = T extends object ? {
[K in keyof T]?: DeepPartial<T[K]>;
} : T;
export interface FireCMSi18nProviderProps {
/** BCP-47 locale tag, e.g. "en", "es", "fr". Defaults to "en". */
locale?: string;
/**
* Override or extend any FireCMS UI string, keyed by locale.
*
* @example
* translations={{
* en: { save: "Publish" },
* es: { save: "Publicar", discard: "Descartar" }
* }}
*/
translations?: {
[locale: string]: DeepPartial<FireCMSTranslations>;
};
}
/**
* Initialises a dedicated i18next instance for FireCMS's internal UI strings.
*
* This instance is isolated from any app-level i18next configuration the
* consumer may have. Mount this at the top of the FireCMS component tree.
*
* @internal
*/
export declare function FireCMSi18nProvider({ locale, translations, children }: PropsWithChildren<FireCMSi18nProviderProps>): import("react/jsx-runtime").JSX.Element | null;
export {};