Locale.GetDisplayName(Locale) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.