Skip to main content

Function: resolveKey()

Resolves a key and its parameters.

Since

2.0.0

Param

The target to fetch the language key from.

Remark

This function also has additional parameters for key, defaultValue, and options, however TSDoc does not let us document those while matching proper implementation. See the overloads for this method for the documentation on those parameters.

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 ParameterDefault type
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.

The data that key held, processed by i18next.

Since

2.0.0

Param

The target to fetch the language key from.

Remark

This function also has additional parameters for key, defaultValue, and options, however TSDoc does not let us document those while matching proper implementation. See the overloads for this method for the documentation on those parameters.

Since

2.0.0

Defined in

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 ParameterDefault type
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.

The data that key held, processed by i18next.

Since

2.0.0

Param

The target to fetch the language key from.

Remark

This function also has additional parameters for key, defaultValue, and options, however TSDoc does not let us document those while matching proper implementation. See the overloads for this method for the documentation on those parameters.

Since

2.0.0

Defined in

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 ParameterDefault type
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.

The data that key held, processed by i18next.

Since

2.0.0

Param

The target to fetch the language key from.

Remark

This function also has additional parameters for key, defaultValue, and options, however TSDoc does not let us document those while matching proper implementation. See the overloads for this method for the documentation on those parameters.

Since

2.0.0

Defined in

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