Represents a locale.

Constructors

  • Creates a Locale

    Parameters

    • lang: string

      The language or the full lang-country string.

    • Optionalcountry: string

      The country.

    Returns Locale

Methods

  • Returns the current Locale.

    Returns Locale

    The current Locale.

  • Set current Locale to given parameter.

    Parameters

    • locale: string | Locale

      The current Locale.

    Returns void

  • Returns the country code.

    Returns string

    The country code.

  • Creates a Intl.Locale instance.

    Returns Locale

    Intl.Locale

  • Returns the language code in 2 alphabetic characters format.

    Returns string

    The language code.

  • The locale string.

    Returns string

    e.g. de-DE or de if no country is present.

  • Checks if country is present.

    Returns boolean

    true if country has non empty value.