Skip to main content

Class: InternationalizationHandler

i18next/src.InternationalizationHandler

Constructors

constructor

new InternationalizationHandler(options?)

Parameters

NameTypeDescription
options?InternationalizationOptions

Defined in

projects/plugins/packages/i18next/src/lib/InternationalizationHandler.ts:58

Properties

backendOptions

Protected Readonly backendOptions: Options

Defined in

projects/plugins/packages/i18next/src/lib/InternationalizationHandler.ts:51


fetchLanguage

fetchLanguage: (context: InternationalizationContext) => Awaitable<null | string>

Type declaration

▸ (context): Awaitable<null | string>

Parameters
NameType
contextInternationalizationContext
Returns

Awaitable<null | string>

Defined in

projects/plugins/packages/i18next/src/lib/InternationalizationHandler.ts:115


languages

Readonly languages: Map<string, TFunction>

Defined in

projects/plugins/packages/i18next/src/lib/InternationalizationHandler.ts:32


languagesDirectory

Readonly languagesDirectory: string

Defined in

projects/plugins/packages/i18next/src/lib/InternationalizationHandler.ts:45


languagesLoaded

languagesLoaded: boolean = false

Defined in

projects/plugins/packages/i18next/src/lib/InternationalizationHandler.ts:20


namespaces

namespaces: Set<string>

Defined in

projects/plugins/packages/i18next/src/lib/InternationalizationHandler.ts:26


options

Readonly options: InternationalizationOptions

Defined in

projects/plugins/packages/i18next/src/lib/InternationalizationHandler.ts:38

Methods

format

format<TResult, TKeys, TInterpolationMap>(locale, key, options?): TResult

Type parameters

NameType
TResultextends TFunctionResult = string
TKeysextends TFunctionKeys = string
TInterpolationMapextends NonNullObject = StringMap

Parameters

NameTypeDescription
localestring
keyTKeys | TKeys[]
options?TOptions<TInterpolationMap>

Returns

TResult

Defined in

projects/plugins/packages/i18next/src/lib/InternationalizationHandler.ts:179


getT

getT(locale): TFunction

Parameters

NameTypeDescription
localestring

Returns

TFunction

Defined in

projects/plugins/packages/i18next/src/lib/InternationalizationHandler.ts:162


init

init(): Promise<void>

Returns

Promise<void>

Defined in

projects/plugins/packages/i18next/src/lib/InternationalizationHandler.ts:121


reloadResources

reloadResources(): Promise<void>

Returns

Promise<void>

Defined in

projects/plugins/packages/i18next/src/lib/InternationalizationHandler.ts:220


walkLocaleDirectory

Private walkLocaleDirectory(directory, ns): AsyncGenerator<string, any, unknown>

Parameters

NameTypeDescription
directorystring
nsstring

Returns

AsyncGenerator<string, any, unknown>

Defined in

projects/plugins/packages/i18next/src/lib/InternationalizationHandler.ts:245


walkRootDirectory

walkRootDirectory(directory): Promise<{ languages: string[] ; namespaces: string[] }>

Parameters

NameTypeDescription
directoryPathLike

Returns

Promise<{ languages: string[] ; namespaces: string[] }>

Defined in

projects/plugins/packages/i18next/src/lib/InternationalizationHandler.ts:200