Skip to content

API reference / @localizer/format-displayname / displayNameFormatter

Function: displayNameFormatter()

displayNameFormatter<T>(type, options?): ValueFormatter<T>

Defined in: displayNameFormatter.ts:32

Creates a localized display name formatter.

Type Parameters

Type ParameterDescription
T extends stringThe value type to format, typically a string.

Parameters

ParameterTypeDescription
type"language" | "region" | "script" | "calendar" | "dateTimeField" | "currency"The display name type, e.g., "language", "region", "script", etc.
options?DisplayNameFormatOptionsFormatting options, including transformations.

Returns

ValueFormatter<T>

A function to format values into localized display names.