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 parameter | Value |
|---|---|
Key extends string | - |
TOpt extends TOptions | TOptions |
Ret extends string | $SpecialObject | TOpt["returnObjects"] extends true ? $SpecialObject : string |
Ns extends Namespace | "translation" |
ActualOptions extends TOptionsBase & $Dictionary | TOpt & InterpolationMap<Ret> |
Parameters
| Parameter | Type | Description |
|---|---|---|
target | Target | The target to fetch the language key from. |
key | Key | Key[] | The i18next key. |
options? | ActualOptions | The 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 parameter | Value |
|---|---|
Key extends string | - |
TOpt extends TOptions | TOptions |
Ret extends string | $SpecialObject | TOpt["returnObjects"] extends true ? $SpecialObject : string |
Ns extends Namespace | "translation" |
ActualOptions extends TOptionsBase & $Dictionary | TOpt & InterpolationMap<Ret> |
Parameters
| Parameter | Type | Description |
|---|---|---|
target | Target | The target to fetch the language key from. |
key | string | string[] | The i18next key. |
options | TOpt & $Dictionary & object | The 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 parameter | Value |
|---|---|
Key extends string | - |
TOpt extends TOptions | TOptions |
Ret extends string | $SpecialObject | TOpt["returnObjects"] extends true ? $SpecialObject : string |
Ns extends Namespace | "translation" |
ActualOptions extends TOptionsBase & $Dictionary | TOpt & InterpolationMap<Ret> |
Parameters
| Parameter | Type | Description |
|---|---|---|
target | Target | The target to fetch the language key from. |
key | string | string[] | The i18next key. |
defaultValue | string | The default value to use if the key is not found. |
options? | TOpt & $Dictionary | The interpolation options. |
Returns
Promise<TFunctionReturnOptionalDetails<Ret, TOpt>>
The data that key held, processed by i18next.
Since
2.0.0