Locale


A Locale object represents a specific geographical, political, or cultural region. An operation that requires a Locale to perform its task is called locale-sensitive and uses the Locale to tailor information for the user. For example, displaying a number is a locale-sensitive operation— the number should be formatted according to the customs and conventions of the user's native country, region, or culture.

See also
TextStyle
SpanStyle

Summary

Public companion properties

Locale

Returns a Locale object which represents current locale

Cmn

Public constructors

Locale(languageTag: String)

Create Locale object from a language tag.

Cmn

Public functions

open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn
String

Returns a IETF BCP47 compliant language tag representation of this Locale.

Cmn
open String
Cmn

Public properties

String

The ISO 639 compliant language code.

Cmn
PlatformLocale

Platform specific Locale object that provides the actual values for the members of this class.

Cmn
String

The ISO 3166 compliant region code.

Cmn
String

The ISO 15924 compliant 4-letter script code.

Cmn

Public companion properties

current

val currentLocale

Returns a Locale object which represents current locale

Public constructors

Locale

Locale(languageTag: String)

Create Locale object from a language tag.

Parameters
languageTag: String

A IETF BCP47 compliant language tag.

Returns
Locale

a locale object

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toLanguageTag

fun toLanguageTag(): String

Returns a IETF BCP47 compliant language tag representation of this Locale.

Returns
String

A IETF BCP47 compliant language tag.

toString

open fun toString(): String

Public properties

language

val languageString

The ISO 639 compliant language code.

platformLocale

val platformLocalePlatformLocale

Platform specific Locale object that provides the actual values for the members of this class.

region

val regionString

The ISO 3166 compliant region code.

script

val scriptString

The ISO 15924 compliant 4-letter script code.