Skip to main content

Function: resolveKey()

resolveKey(target, key, options)

resolveKey<Key, TOpt, Ret, Ns, ActualOptions>(target: Target, key: Key | Key[], options?: ActualOptions): Promise<TFunctionReturnOptionalDetails<Ret, TOpt>>

Resolves a key and its parameters.

Type parameters

Type parameterValue
Key extends string-
TOpt extends TOptionsTOptions
Ret extends string | $SpecialObjectTOpt["returnObjects"] extends true ? $SpecialObject : string
Ns extends Namespace"translation"
ActualOptions extends TOptionsBase & $DictionaryTOpt & InterpolationMap<Ret>

Parameters

ParameterTypeDescription
targetTargetThe target to fetch the language key from.
keyKey | Key[]The i18next key.
options?ActualOptionsThe options to be passed to TFunction.

Returns

Promise<TFunctionReturnOptionalDetails<Ret, TOpt>>

The data that key held, processed by i18next.

Since

2.0.0

Source

projects/plugins/packages/i18next/src/lib/functions.ts:86

resolveKey(target, key, options)

resolveKey<Key, TOpt, Ret, Ns, ActualOptions>(target: Target, key: string | string[], options: TOpt & $Dictionary & object): Promise<TFunctionReturnOptionalDetails<Ret, TOpt>>

Resolves a key and its parameters.

Type parameters

Type parameterValue
Key extends string-
TOpt extends TOptionsTOptions
Ret extends string | $SpecialObjectTOpt["returnObjects"] extends true ? $SpecialObject : string
Ns extends Namespace"translation"
ActualOptions extends TOptionsBase & $DictionaryTOpt & InterpolationMap<Ret>

Parameters

ParameterTypeDescription
targetTargetThe target to fetch the language key from.
keystring | string[]The i18next key.
optionsTOpt & $Dictionary & objectThe interpolation options as well as a defaultValue for the key and any key/value pairs.

Returns

Promise<TFunctionReturnOptionalDetails<Ret, TOpt>>

The data that key held, processed by i18next.

Since

2.0.0

Source

projects/plugins/packages/i18next/src/lib/functions.ts:102

resolveKey(target, key, defaultValue, options)

resolveKey<Key, TOpt, Ret, Ns, ActualOptions>(target: Target, key: string | string[], defaultValue: string, options?: TOpt & $Dictionary): Promise<TFunctionReturnOptionalDetails<Ret, TOpt>>

Resolves a key and its parameters.

Type parameters

Type parameterValue
Key extends string-
TOpt extends TOptionsTOptions
Ret extends string | $SpecialObjectTOpt["returnObjects"] extends true ? $SpecialObject : string
Ns extends Namespace"translation"
ActualOptions extends TOptionsBase & $DictionaryTOpt & InterpolationMap<Ret>

Parameters

ParameterTypeDescription
targetTargetThe target to fetch the language key from.
keystring | string[]The i18next key.
defaultValuestringThe default value to use if the key is not found.
options?TOpt & $DictionaryThe interpolation options.

Returns

Promise<TFunctionReturnOptionalDetails<Ret, TOpt>>

The data that key held, processed by i18next.

Since

2.0.0

Source

projects/plugins/packages/i18next/src/lib/functions.ts:119