@cartridge-engine/i18n
    Preparing search index...

    Interface LanguageProviderProps

    Props for the LanguageProvider component.

    Provide at least one of resources (inline translation object) or path (directory of {locale}.json files).

    interface LanguageProviderProps {
        children: ReactNode;
        defaultContext?: string;
        defaultLanguage?: string;
        fallbackLanguage?: string;
        path?: string;
        resources?: Record<string, Record<string, string>>;
    }
    Index
    children: ReactNode

    Child React tree that receives i18n context.

    defaultContext?: string

    Default context applied to every t() call unless an explicit context option is passed.

    When set, t('greeting') behaves as if every call were t('greeting', { context: defaultContext }) — it first tries key.<defaultContext>, then falls back to key, then to the key itself.

    Can be changed dynamically via the setDefaultContext API returned by useI18n().

    <LanguageProvider defaultContext="male" ...>
    // t('greeting') → looks up 'greeting.male' first
    </LanguageProvider>
    defaultLanguage?: string

    Initial language code. Defaults to the first available locale.

    fallbackLanguage?: string

    Fallback language to try when a key is missing in the current language. If the key is also missing in the fallback, the key itself is returned.

    path?: string

    Path to a directory scanned synchronously for {locale}.json files. Each file becomes one language resource.

    resources?: Record<string, Record<string, string>>

    Inline translation resources keyed by locale code.

    resources={{ 'en-US': { hello: 'Hello' }, 'zh-CN': { hello: 'Nǐ hǎo' } }}