API reference / @localizer/core / loc
Function: loc()
Call Signature
loc<
T
>(localize
):Localizable
<T
>
Defined in: fn/localizable/loc.ts:35
Creates a Localizable
from a localization function.
Type Parameters
Type Parameter | Default type | Description |
---|---|---|
T | string | The type of the localized value. |
Parameters
Parameter | Type | Description |
---|---|---|
localize | (locale ) => T | Function returning a localized value for a given locale. |
Returns
Localizable
<T
>
A Localizable
representing the localized value.
See
Call Signature
loc(
strings
, ...expr
):Localizable
Defined in: fn/localizable/loc.ts:49
Creates a Localizable
instance using template strings and expressions.
Parameters
Parameter | Type | Description |
---|---|---|
strings | TemplateStringsArray | The template strings. |
...expr | Localizable [] | Expressions to interpolate into the template. |
Returns
A Localizable
instance for the localized value.