Appearance
Interface: Translator
Defined in: types.ts:17
Translator instance interface
Properties
__
Defined in: types.ts:19
Main translation function (alias for translate)
addTranslations
addTranslations: (
locale,translations) =>void
Defined in: types.ts:29
Add translations to an existing locale
Parameters
locale
string
translations
Returns
void
getAvailableLocales
getAvailableLocales: () =>
string[]
Defined in: types.ts:33
Get all available locales
Returns
string[]
getLocale
getLocale: () =>
string
Defined in: types.ts:25
Get the current locale
Returns
string
hasTranslation
hasTranslation: (
path,locale?) =>boolean
Defined in: types.ts:31
Check if a translation key exists
Parameters
path
string
locale?
string | null
Returns
boolean
setLocale
setLocale: (
locale) =>void
Defined in: types.ts:23
Set the current locale
Parameters
locale
string
Returns
void
setTranslations
setTranslations: (
locale,translations) =>void
Defined in: types.ts:27
Set translations for a specific locale
Parameters
locale
string
translations
Returns
void
translate
translate:
TranslateFunction
Defined in: types.ts:21
Main translation function