---
title: "Locale"
description: "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."
type: "class"
---

<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
expect 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.


## Secondary Constructors

```kotlin
constructor(languageTag: String)
```


Create Locale object from a language tag.

#### Parameters

| | |
| --- | --- |
| languageTag | A `IETF BCP47`(https://tools.ietf.org/html/bcp47) compliant language tag. |


#### Returns

| | |
| --- | --- |
|  | a locale object |



## Properties

<div class='sourceset sourceset-common'>Common</div>


```kotlin
val language: String
```


The ISO 639 compliant language code.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
val script: String
```


The ISO 15924 compliant 4-letter script code.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
val region: String
```


The ISO 3166 compliant region code.



## Functions

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


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

#### Returns

| | |
| --- | --- |
|  | A IETF BCP47 compliant language tag. |



## Companion Object

#### Properties

<div class='sourceset sourceset-common'>Common</div>


```kotlin
val current: Locale
```


Returns a `Locale` object which represents current locale




<div class='sourceset sourceset-jvmAndAndroid'>JvmAndAndroid</div>


```kotlin
actual class Locale(val platformLocale: JavaLocale)
```

## Secondary Constructors

```kotlin
actual constructor(languageTag: String) : this(parseLanguageTag(languageTag))
```

## Properties

<div class='sourceset sourceset-jvmAndAndroid'>JvmAndAndroid</div>


```kotlin
actual val language: String
```


<div class='sourceset sourceset-jvmAndAndroid'>JvmAndAndroid</div>


```kotlin
actual val script: String
```


<div class='sourceset sourceset-jvmAndAndroid'>JvmAndAndroid</div>


```kotlin
actual val region: String
```


## Functions

```kotlin
actual fun toLanguageTag(): String
```

## Companion Object

#### Properties

<div class='sourceset sourceset-jvmAndAndroid'>JvmAndAndroid</div>


```kotlin
actual val current: Locale
```




