Monster.I18n. Locale

The Locale class is a base class for the language classes.

RFC

A Language-Tag consists of:
langtag                           ; generated tag
          -or- private-use        ; a private use tag

langtag       = (language
                   ["-" script]
                   ["-" region]
                   *("-" variant)
                   *("-" extension)
                   ["-" privateuse])

language      = "en", "ale", or a registered value

script        = "Latn", "Cyrl", "Hant" ISO 15924 codes

region        = "US", "CS", "FR" ISO 3166 codes
                "419", "019",  or UN M.49 codes

variant       = "rozaj", "nedis", "1996", multiple subtags can be used in a tag

extension     = single letter followed by additional subtags; more than one extension
                may be used in a language tag

private-use   = "x-" followed by additional subtags, as many as are required
                Note that these can start a tag or appear at the end (but not
                in the middle)

Constructor

new Locale(language, regionopt, scriptopt, variantsopt, extlangopt, privateUseopt)

Parameters:
NameTypeAttributesDescription
languagestring
regionstring<optional>
scriptstring<optional>
variantsstring<optional>
extlangstring<optional>
privateUsestring<optional>
Since
  • 1.13.0
License
  • AGPLv3
Throws:

unsupported locale

Type
Error

Members

extlang

language

localeString

privateUse

region

script

variants

(static) instanceSymbol

This method is called by the instanceof operator.

This method is called by the instanceof operator.

Since
  • 3.27.0

Methods

getMap() → {Monster.I18n.LocaleMap}

The structure has the following: language, script, region, variants, extlang, privateUse

.

The structure has the following: language, script, region, variants, extlang, privateUse

Returns:
Type: 
Monster.I18n.LocaleMap

toString() → {string}

Returns:
Type: 
string