Sanity Library Reference Docs
    Preparing search index...

    Interface LocaleSource

    Internal representation of the available locale configuration.

    Generally not something you will want to use directly.

    interface LocaleSource {
        currentLocale: Locale;
        locales: Locale[];
        t: TFunction;
        loadNamespaces(namespaces: string[]): Promise<void>;
    }
    Index

    Methods

    • Loads the given namespaces, if not already done.

      Parameters

      • namespaces: string[]

        Array of namespace names to load

      Returns Promise<void>

      Promise which resolves once loaded.

    Properties

    currentLocale: Locale

    Current locale ID (eg en-US, nb-NO, th-TH…)

    locales: Locale[]

    Array of locale definitions

    t: TFunction

    Translation function, eg t('some.key') => 'Some string'