Skip to content

API reference / @localizer/core / localizeObject

Function: localizeObject()

localizeObject<T>(values, locale): Localized<T>

Defined in: fn/localizable/localizeObject.ts:34

Localizes an object's properties by converting Localizable values to their localized forms.

Type Parameters

Type ParameterDescription
T extends Record<string, unknown>The input object type with properties that may be Localizable.

Parameters

ParameterTypeDescription
valuesTThe object with properties to localize.
localenull | LocaleCodeThe locale code for localization, or null for a default.

Returns

Localized<T>

A new object with Localizable properties replaced by localized values.

See

Localizable