getDisplayCountry (JavaScript)

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

If possible, the name returned will be localized according to Locale or you can return the default locale. For example, if the locale is fr_FR and Locale is en_US, getDisplayCountry() will return "France"; if the locale is en_US and Locale is fr_FR, getDisplayLanguage() will return "Etats-Unis". If the name returned cannot be localized according to Locale. (say, there is no Japanese name for Croatia), 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 country, this function returns the empty string.

Defined in

Locale (Runtime - JavaScript)

Syntax

getDisplayCountry() : string

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