Locales

Function

Android
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.

Code Examples

DeviceConfigurationOverrideLocalesSample

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