getDisplayName (Locale - JavaScript)

Returns a name for the locale that is appropriate for display to the user. This will be the values returned by getDisplayLanguage(), getDisplayCountry(), and getDisplayVariant() assembled into a single string.

The display name will have one of the following forms:

  • language (country, variant)
  • language (country)
  • language (variant)
  • country (variant)
  • language
  • country
  • variant

language (country) language (variant)

country (variant)depending on which fields are specified in the locale. If the language, country, and variant fields are all empty, this function returns the empty string..

Defined in

Locale (Runtime - JavaScript)

Syntax

getDisplayName() : string

getDisplayName(Locale:Locale) : string
Return value Description
string The name for the locale that is appropriate for display to the user