Constructors
constructor
- new I18n(_options?: InitOptions<object> & { fsTranslationsPath?: string }): I18n
Parameters
Optional_options: InitOptions<object> & { fsTranslationsPath?: string }
Accessors
i18next
- get i18next(): i18n
Returns i18n
language
- get language(): string
Returns string
ns
- get ns(): {
common: TFunction<"translation", undefined>;
coreutils: TFunction<"translation", undefined>;
filesystem: TFunction<"translation", undefined>;
kernel: TFunction<"translation", undefined>;
terminal: TFunction<"translation", undefined>;
} Returns {
common: TFunction<"translation", undefined>;
coreutils: TFunction<"translation", undefined>;
filesystem: TFunction<"translation", undefined>;
kernel: TFunction<"translation", undefined>;
terminal: TFunction<"translation", undefined>;
}
t
- get t(): TFunction<["translation", ...string[]], undefined>
Returns TFunction<["translation", ...string[]], undefined>
Methods
detectBrowserLanguage
- detectBrowserLanguage(): string
Returns string
languageToLocale
- languageToLocale(language: string): string
Returns string
loadFilesystemResources
- loadFilesystemResources(
fs: I18nFilesystemAdapter,
rootPath?: string,
): Promise<I18nResourceLoadResult> Parameters
- fs: I18nFilesystemAdapter
OptionalrootPath: string
Returns Promise<I18nResourceLoadResult>
localeToLanguage
- localeToLanguage(locale: string): string
Returns string
setLanguage
- setLanguage(locale: string): void
Returns void
Detects the browser language using the language detector Returns the detected language code (e.g., 'en', 'es')