Optional
options:
I18nOptions
Optional
fetcher
Readonly
lang$
A Readable of current lang.
Readonly
locale$
A Readable of current locale.
Readonly
locales$
A Writable of all loaded locales.
Readonly
t
Translation function that uses the current t$
function.
Readonly
t$
A Readable of current translate function.
Current lang.
Current locale
All loaded locales.
Add a locale to the locales.
Use i18n.locales$.set()
for more control.
— boolean indicating whether a message with the specified key in current language exists or not.
Change language.
— a promise that resolves when the new locale is fetched.
Static
preload
Fetch locale of initialLang
and return an I18n instance with the locale.
Fetch locale of the specified lang.