Skip to content

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

Localizable

Call Signature

Localizer<T>(localizable): T

Defined in: types/localizer.ts:39

Returns the localized value for the given input.

Type Parameters

Type ParameterDescription
TType of the localized value.

Parameters

ParameterTypeDescription
localizableLocalizable<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 ParameterDescription
A extends unknown[]The argument types for the function.
TThe localized value type.

Parameters

ParameterTypeDescription
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

ParameterType
...argsA

Returns

T

Properties

PropertyModifierTypeDescription
localereadonlyLocaleCodeThe selected locale code.