Skip to content

API Reference


API Reference / @dasch-ng/utils / intl/src / IntlDisplayNamePipe

Class: IntlDisplayNamePipe ​

Defined in: libs/ng/utils/intl/src/lib/intl-display-name.pipe.ts:17

Turns a code into its localized name with Intl.DisplayNames: a region (DE), language (de-AT), currency (EUR), script (Latn), calendar or date-time field. Region codes may be lowercase. Unknown or malformed codes return the code itself.

Example ​

html
{{ address.country | intlDisplayName }}                   <!-- Germany -->
{{ 'de-AT' | intlDisplayName: 'language' }}               <!-- Austrian German -->
{{ 'EUR' | intlDisplayName: 'currency' : 'de' }}          <!-- Euro -->

Extends ​

  • IntlPipeBase

Implements ​

  • PipeTransform

Constructors ​

Constructor ​

new IntlDisplayNamePipe(): IntlDisplayNamePipe

Returns ​

IntlDisplayNamePipe

Inherited from ​

IntlPipeBase.constructor

Methods ​

locale() ​

protected locale(locale?): string

Defined in: libs/ng/utils/intl/src/lib/formatter-cache.ts:29

Parameters ​

locale? ​

string

Returns ​

string

Inherited from ​

IntlPipeBase.locale


transform() ​

transform(code, type?, locale?): string

Defined in: libs/ng/utils/intl/src/lib/intl-display-name.pipe.ts:18

Parameters ​

code ​

string | null | undefined

type? ​

DisplayNamesType = 'region'

locale? ​

string

Returns ​

string

Implementation of ​

PipeTransform.transform

Released under the MIT License.