Locale Locale Class

Definition

Locale represents a language/country/variant combination.

[Android.Runtime.Register("java/util/Locale", ApiSince=1, DoNotGenerateAcw=true)]
public sealed class Locale : Java.Lang.Object, IDisposable, Java.IO.ISerializable, Java.Lang.ICloneable
type Locale = class
    inherit Object
    interface ISerializable
    interface IJavaObject
    interface IDisposable
    interface ICloneable
Inheritance
Attributes
Implements

Remarks

Android platform documentation

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.

Constructors

Locale(String) Locale(String)

Constructs a new Locale using the specified language.

Locale(String, String) Locale(String, String)

Constructs a new Locale using the specified language and country codes.

Locale(String, String, String) Locale(String, String, String)

Constructs a new Locale using the specified language, country, and variant codes.

Fields

PrivateUseExtension PrivateUseExtension
UnicodeLocaleExtension UnicodeLocaleExtension

Properties

Canada Canada

Locale constant for en_CA.

CanadaFrench CanadaFrench

Locale constant for fr_CA.

China China

Locale constant for zh_CN.

Chinese Chinese

Locale constant for zh.

Class Class

Returns the unique instance of Class that represents this object's class.

(Inherited from Object)
Country Country

Returns the country code for this locale, or "" if this locale doesn't correspond to a specific country.

Default Default

Returns the user's preferred locale.

DisplayCountry DisplayCountry

Equivalent to getDisplayCountry(Locale.getDefault()).

DisplayLanguage DisplayLanguage

Equivalent to getDisplayLanguage(Locale.getDefault()).

DisplayName DisplayName

Equivalent to getDisplayName(Locale.getDefault()).

DisplayScript DisplayScript

Equivalent to getDisplayScript(Locale.getDefault()))

DisplayVariant DisplayVariant

Returns the full variant name in the default Locale for the variant code of this Locale.

English English

Locale constant for en.

ExtensionKeys ExtensionKeys

Returns the set of BCP-47 extensions this locale contains.

France France

Locale constant for fr_FR.

French French

Locale constant for fr.

German German

Locale constant for de.

Germany Germany

Locale constant for de_DE.

Handle Handle

The handle to the underlying Android instance.

(Inherited from Object)
HasExtensions HasExtensions
IJavaObjectEx.IsProxy IJavaObjectEx.IsProxy Inherited from Object
IJavaObjectEx.KeyHandle IJavaObjectEx.KeyHandle Inherited from Object
IJavaObjectEx.NeedsActivation IJavaObjectEx.NeedsActivation Inherited from Object
IJavaPeerable.JniManagedPeerState IJavaPeerable.JniManagedPeerState Inherited from Object
ISO3Country ISO3Country

Returns the three-letter ISO 3166 country code which corresponds to the country code for this Locale.

ISO3Language ISO3Language

Returns the three-letter ISO 639-2/T language code which corresponds to the language code for this Locale.

Italian Italian

Locale constant for it.

Italy Italy

Locale constant for it_IT.

Japan Japan

Locale constant for ja_JP.

Japanese Japanese

Locale constant for ja.

JniIdentityHashCode JniIdentityHashCode Inherited from Object
JniPeerMembers JniPeerMembers
Korea Korea

Locale constant for ko_KR.

Korean Korean

Locale constant for ko.

Language Language

Returns the language code for this Locale or the empty string if no language was set.

PeerReference PeerReference Inherited from Object
Prc Prc

Locale constant for zh_CN.

Root Root

Locale constant for the root locale.

Script Script

Returns the script code for this Locale or an empty String if no script was set.

SimplifiedChinese SimplifiedChinese

Locale constant for zh_CN.

Taiwan Taiwan

Locale constant for zh_TW.

ThresholdClass ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
TraditionalChinese TraditionalChinese

Locale constant for zh_TW.

Uk Uk

Locale constant for en_GB.

UnicodeLocaleAttributes UnicodeLocaleAttributes

Returns the set of unicode locale extension attributes this locale contains.

UnicodeLocaleKeys UnicodeLocaleKeys

Returns the set of unicode locale extension keywords this locale contains.

Us Us

Locale constant for en_US.

Variant Variant

Returns the variant code for this Locale or an empty String if no variant was set.

Methods

Clone() Clone()

Creates and returns a copy of this Object.

Dispose() Dispose() Inherited from Object
Dispose(Boolean) Dispose(Boolean) Inherited from Object
Equals(Object) Equals(Object)

Compares this instance with the specified object and indicates if they are equal.

(Inherited from Object)
Filter(IList<Locale>, ICollection<Locale>) Filter(IList<Locale>, ICollection<Locale>)
Filter(IList<Locale>, ICollection<Locale>, Locale+FilteringMode) Filter(IList<Locale>, ICollection<Locale>, Locale+FilteringMode)
FilterTags(IList<Locale>, ICollection<String>) FilterTags(IList<Locale>, ICollection<String>)
FilterTags(IList<Locale>, ICollection<String>, Locale+FilteringMode) FilterTags(IList<Locale>, ICollection<String>, Locale+FilteringMode)
ForLanguageTag(String) ForLanguageTag(String)

Returns a locale for a given BCP-47 language tag.

GetAvailableLocales() GetAvailableLocales()

Returns the system's installed locales.

GetDefault(Locale+Category) GetDefault(Locale+Category)
GetDisplayCountry(Locale) GetDisplayCountry(Locale)

Returns the name of this locale's country, localized to locale.

GetDisplayLanguage(Locale) GetDisplayLanguage(Locale)

Returns the name of this locale's language, localized to locale.

GetDisplayName(Locale) GetDisplayName(Locale)

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

GetDisplayScript(Locale) GetDisplayScript(Locale)

Returns the name of this locale's script code, localized to Locale.

GetDisplayVariant(Locale) GetDisplayVariant(Locale)

Returns the full variant name in the specified Locale for the variant code of this Locale.

GetExtension(Char) GetExtension(Char)

Returns the BCP-47 extension whose key is extensionKey, or null if this locale does not contain the extension.

GetHashCode() GetHashCode()

Returns an integer hash code for this object.

(Inherited from Object)
GetISOCountries() GetISOCountries()

Returns an array of strings containing all the two-letter ISO 3166 country codes that can be used as the country code when constructing a Locale.

GetISOLanguages() GetISOLanguages()

Returns an array of strings containing all the two-letter ISO 639-1 language codes that can be used as the language code when constructing a Locale.

GetUnicodeLocaleType(String) GetUnicodeLocaleType(String)

Returns the type for the specified unicode locale extension key.

JavaFinalize() JavaFinalize()

Invoked when the garbage collector has detected that this instance is no longer reachable.

(Inherited from Object)
Lookup(IList<Locale>, ICollection<Locale>) Lookup(IList<Locale>, ICollection<Locale>)
LookupTag(IList<Locale>, ICollection<String>) LookupTag(IList<Locale>, ICollection<String>)
Notify() Notify()

Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
NotifyAll() NotifyAll()

Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
SetDefault(Locale+Category, Locale) SetDefault(Locale+Category, Locale)
SetHandle(IntPtr, JniHandleOwnership) SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
StripExtensions() StripExtensions()
ToArray<T>() ToArray<T>() Inherited from Object
ToLanguageTag() ToLanguageTag()

Returns a well formed BCP-47 language tag that identifies this locale.

ToString() ToString()

Returns the string representation of this Locale.

UnregisterFromRuntime() UnregisterFromRuntime() Inherited from Object
Wait() Wait()

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

(Inherited from Object)
Wait(Int64) Wait(Int64)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wait(Int64, Int32) Wait(Int64, Int32)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)

Explicit Interface Implementations

IJavaObjectEx.ToLocalJniHandle() IJavaObjectEx.ToLocalJniHandle() Inherited from Object
IJavaPeerable.Disposed() IJavaPeerable.Disposed() Inherited from Object
IJavaPeerable.DisposeUnlessReferenced() IJavaPeerable.DisposeUnlessReferenced() Inherited from Object
IJavaPeerable.Finalized() IJavaPeerable.Finalized() Inherited from Object
IJavaPeerable.SetJniIdentityHashCode(Int32) IJavaPeerable.SetJniIdentityHashCode(Int32) Inherited from Object
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) Inherited from Object
IJavaPeerable.SetPeerReference(JniObjectReference) IJavaPeerable.SetPeerReference(JniObjectReference) Inherited from Object

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable) GetJniTypeName(IJavaPeerable)

Applies to