API reference / @localizer/translate / translationMap
Function: translationMap() experimental
Call Signature
translationMap<
V
>(map
):ValueFormatter
<V
>
Defined in: fn/translationMap.ts:54
Translation function for dynamic values.
Creates a value formatter that dynamically generates a translation map based on the input value.
Type Parameters
Type Parameter | Description |
---|---|
V | The type of the input value. |
Parameters
Parameter | Type | Description |
---|---|---|
map | (value ) => TranslationMap | A function that generates a translation map for the given value. |
Returns
A function that formats the input value into a localized string.
Call Signature
translationMap(
map
):Localizable
Defined in: fn/translationMap.ts:68
experimental
Translation function for static maps.
Resolves the appropriate translation for the current locale based on the provided translation map.
Parameters
Parameter | Type | Description |
---|---|---|
map | TranslationMap | A static translation map containing locale codes and their translations. |
Returns
A localized string based on the current locale.