Skip to content

Interface: Translator ​

Defined in: types.ts:17

Translator instance interface

Properties ​

__ ​

__: TranslateFunction

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 ​

TranslationObject

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 ​

TranslationObject

Returns ​

void


translate ​

translate: TranslateFunction

Defined in: types.ts:21

Main translation function

Documentation of 1.0.15 , built from 199a9ac on 1.0.15 by pipeline #2985012233 on 2026-10-21.