API reference / @localizer/core / Localizer
Interface: Localizer()
Defined in: types/localizer.ts:27
Interface for localizing values and formatting functions. Supports various types of localizable objects and formatters.
See
Call Signature
Localizer<
T
>(localizable
):T
Defined in: types/localizer.ts:39
Returns the localized value for the given input.
Type Parameters
Type Parameter | Description |
---|---|
T | Type of the localized value. |
Parameters
Parameter | Type | Description |
---|---|---|
localizable | Localizable <T > | The input to localize. |
Returns
T
Localized value of type T
.
Call Signature
Localizer<
A
,T
>(formatter
): (...args
) =>T
Defined in: types/localizer.ts:53
Localizes a function that returns a localizable value.
Type Parameters
Type Parameter | Description |
---|---|
A extends unknown [] | The argument types for the function. |
T | The localized value type. |
Parameters
Parameter | Type | Description |
---|---|---|
formatter | (...args ) => Localizable <T > | A function accepting arguments of type A and returning Localizable<T> . |
Returns
A function accepting arguments of type A
and returning T
.
(...
args
):T
Parameters
Parameter | Type |
---|---|
...args | A |
Returns
T
Properties
Property | Modifier | Type | Description |
---|---|---|---|
locale | readonly | LocaleCode | The selected locale code. |