getDisplayLanguage (JavaScript)

Returns a name for the locale's language that is appropriate for display to the user.

If possible, the name returned will be localized according to Locale. For example, if the locale is fr_FR and Locale is en_US, getDisplayLanguage() will return "French"; if the locale is en_US and inLocale is fr_FR, getDisplayLanguage() will return "anglais". If the name returned cannot be localized according to inLocale, (say, there is no Japanese name for Croatian), this function falls back on the default locale, on the English name, and finally on the ISO code as a last-resort value. If the locale doesn't specify a language, this function returns the empty string.

Defined in

Locale (Runtime - JavaScript)

Syntax

getDisplayLanguage() : string

getDisplayLanguage(Locale:Locale) : string
Return value Description
string The name for the locale's language that is appropriate for display to the user.