Skip to content

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 ParameterDefault typeDescription
TstringThe type of the localized value.

Parameters

ParameterTypeDescription
localize(locale) => TFunction returning a localized value for a given locale.

Returns

Localizable<T>

A Localizable representing the localized value.

See

Localizable , Localizer

Call Signature

loc(strings, ...expr): Localizable

Defined in: fn/localizable/loc.ts:49

Creates a Localizable instance using template strings and expressions.

Parameters

ParameterTypeDescription
stringsTemplateStringsArrayThe template strings.
...exprLocalizable[]Expressions to interpolate into the template.

Returns

Localizable

A Localizable instance for the localized value.

See

Localizable , Localizer