Locale
@Immutable class Locale
kotlin.Any | |
↳ | androidx.compose.ui.text.intl.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.
Summary
Public constructors | |
---|---|
Create Locale object from a language tag. |
Public methods | |
---|---|
Boolean | |
Int |
hashCode() |
String |
Returns a IETF BCP47 compliant language tag representation of this Locale. |
String |
toString() |
Properties | |
---|---|
String |
The ISO 639 compliant language code. |
String |
The ISO 3166 compliant region code. |
String |
The ISO 15924 compliant 4-letter script code. |
Companion properties | |
---|---|
Locale |
Returns a Locale object which represents current locale |
Public constructors
<init>
Locale(languageTag: String)
Create Locale object from a language tag.
Parameters | |
---|---|
languageTag: String | A IETF BCP47 compliant language tag. |
Return | |
---|---|
a locale object |
Public methods
hashCode
fun hashCode(): Int
toLanguageTag
fun toLanguageTag(): String
Returns a IETF BCP47 compliant language tag representation of this Locale.
Return | |
---|---|
A IETF BCP47 compliant language tag. |
toString
fun toString(): String