---
title: "Locales"
description: "A [DeviceConfigurationOverride] that overrides the locales for the contained content.

This will change resource resolution for the content under test, and also override the layout
direction as specified by the locales."
type: "function"
---

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


<a id='references'></a>
<div class='sourceset sourceset-android'>Android</div>


```kotlin
fun DeviceConfigurationOverride.Companion.Locales(
    locales: LocaleList
): DeviceConfigurationOverride
```


A `DeviceConfigurationOverride` that overrides the locales for the contained content.

This will change resource resolution for the content under test, and also override the layout
direction as specified by the locales.

#### Parameters

| | |
| --- | --- |
| locales | the `LocaleList` to use for the content under test. |


#### Returns

| | |
| --- | --- |
|  | a `DeviceConfigurationOverride` that specifies the locales for the content under test. |




## Code Examples
### DeviceConfigurationOverrideLocalesSample
```kotlin
@Composable
fun DeviceConfigurationOverrideLocalesSample() {
    DeviceConfigurationOverride(DeviceConfigurationOverride.Locales(LocaleList("es-ES"))) {
        MyScreen() // will be rendered with overridden locale
    }
}
```

