Options
All
  • Public
  • Public/Protected
  • All
Menu

A class for holding all supported locales. You can add your own, add aliases, or set the current locale.

Hierarchy

  • Locales

Index

Properties

Accessors

Methods

Object literals

Properties

Static ref

ref: Ref<Locale> = new Ref<Locale>(en, true)

The reference to the current locale.

Accessors

Static current

current:

The current locale.

Methods

Static add

  • add(key: string | string[], locale: Locale): void
  • Adds a new locale under one or many keys.

    Parameters

    • key: string | string[]

      The locale key or keys.

    • locale: Locale

      The locale definition.

    Returns void

Static alias

  • alias(key: string, aliases: string[]): void
  • Aliases an existing locale with other keys.

    Parameters

    • key: string

      The existing locale to alias.

    • aliases: string[]

      The other keys to use an aliases.

    Returns void

Static get

  • Returns the locale with the given code. If the code does not map to a locale the current locale is returned.

    Parameters

    • key: string

      The code to get the locale for.

    Returns Locale

Static normal

  • normal(x: string): string
  • Normalizes a locale code to a map key.

    Parameters

    • x: string

      The code to normalize to a key.

    Returns string

Static set

  • set(key: string): boolean
  • Sets the current locale to the locale with the given key. If no locale exists with the given key, false is returned.

    When the global locale changes all Day instances created with an unspecified locale will lazily update their locale-based values when they are accessed following a locale change.

    Parameters

    • key: string

      The key of a locale.

    Returns boolean

    True if the locale was found, otherwise false.

Object literals

Static map

map: object

The map of locales available.

en

en: Locale

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc