Udostępnij za pośrednictwem


Locale.GetDisplayName(Locale) Method

Definition

Returns this locale's language name, country name, and variant, localized to locale.

[Android.Runtime.Register("getDisplayName", "(Ljava/util/Locale;)Ljava/lang/String;", "")]
public string GetDisplayName (Java.Util.Locale locale);
[<Android.Runtime.Register("getDisplayName", "(Ljava/util/Locale;)Ljava/lang/String;", "")>]
member this.GetDisplayName : Java.Util.Locale -> string

Parameters

locale
Locale

Returns

The name of the locale appropriate to display.

Attributes

Remarks

Returns this locale's language name, country name, and variant, localized to locale. The exact output form depends on whether this locale corresponds to a specific language, script, country and variant.

For example: <ul> <li>new Locale("en").getDisplayName(Locale.US) -> English<li>new Locale("en", "US").getDisplayName(Locale.US) -> English (United States)<li>new Locale("en", "US", "POSIX").getDisplayName(Locale.US) -> English (United States,Computer)<li>Locale.forLanguageTag("zh-Hant-CN").getDisplayName(Locale.US) -> Chinese (Traditional Han,China)<li>new Locale("en").getDisplayName(Locale.FRANCE) -> anglais<li>new Locale("en", "US").getDisplayName(Locale.FRANCE) -> anglais (États-Unis)<li>new Locale("en", "US", "POSIX").getDisplayName(Locale.FRANCE) -> anglais (États-Unis,informatique). </ul>

Java documentation for java.util.Locale.getDisplayName(java.util.Locale).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to