@seasketch/geoprocessing
Version:
Geoprocessing and reporting framework for SeaSketch 2.0
23 lines (22 loc) • 1.18 kB
TypeScript
/**
* Returns an instance of i18n that lazy loads translations using passed langPath,
* defaults to './lang' which gp projects will have by default.
* JSON language modules are bundled using Vite's glob import.
*
* Each call to this function returns an independent instance allowing
* for multiple instances of i18n to be used in the same application.
* Because GP cand GP projects contain a component library with multiple
* report clients potentially loaded in storybook this is needed. In
* production there will typically be only one report client loaded at one time
* but this allows for the possibility of multiple. Note that i18nProvider
* must be used with createInstance to load translations.
* @returns i18n instance
*/
export declare function createI18nAsyncInstance(
/** i18n language paths relative to this directory */
options?: {
/** path to main language translations. If baseLangPath present, then will merge with and override base resources */
langPath?: string;
/** path to extra base language translations (for gp projects), which langPath strings merge with and override */
baseLangPath?: string;
}): import("i18next").i18n;