# Locale

Artifact: [androidx.compose.ui:ui-text](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/text/intl/Locale.+class:androidx.compose.ui.text.intl.Locale) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  class 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 |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle` |   |

## Summary

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale#current()` **This property is deprecated.** Locale.current is not backed by snapshot state and does not notify readers on updates. | Cmn android |

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale#Locale(kotlin.String)(languageTag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Create Locale object from a language tag. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale#Locale(java.util.Locale)(platformLocale: https://developer.android.com/reference/java/util/Locale.html)` | android |

| ### Public functions |
|---|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | Cmn android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale#hashCode()()` | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale#toLanguageTag()()` Returns a IETF BCP47 compliant language tag representation of this Locale. | Cmn android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale#toString()()` | Cmn android |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale#language()` The ISO 639 compliant language code. | Cmn android |
| `https://developer.android.com/reference/java/util/Locale.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale#platformLocale()` | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale#region()` The ISO 3166 compliant region code. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale#script()` The ISO 15924 compliant 4-letter script code. | Cmn android |

## Public companion properties

### current

Cmn android Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Deprecated in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
val current: Locale
```

> [!CAUTION]
> **This property is deprecated.**   
> Locale.current is not backed by snapshot state and does not notify readers on updates. In @Composable functions, use LocalLocale.current instead. Outside composables, pass the current locale explicitly from an observable state source, use this instead:
>
> ```kotlin
> LocalLocale.current
> ```

Returns a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale` object which represents current locale

## Public constructors

### Locale

Cmn android Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
Locale(languageTag: String)
```

Create Locale object from a language tag.

| Parameters |
|---|---|
| `languageTag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | A [IETF BCP47](https://tools.ietf.org/html/bcp47) compliant language tag. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale` | a locale object |

### Locale

android Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
Locale(platformLocale: Locale)
```

## Public functions

### equals

Cmn android Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

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

### hashCode

Cmn android

```
open fun hashCode(): Int
```

### toLanguageTag

Cmn android Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun toLanguageTag(): String
```

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

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | A IETF BCP47 compliant language tag. |

### toString

Cmn android

```
open fun toString(): String
```

## Public properties

### language

Cmn android Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val language: String
```

The ISO 639 compliant language code.

### platformLocale

android Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.7.0)

```
val platformLocale: Locale
```

### region

Cmn android Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val region: String
```

The ISO 3166 compliant region code.

### script

Cmn android Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val script: String
```

The ISO 15924 compliant 4-letter script code.