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.

Parameters

localesthe LocaleList to use for the content under test.

Returns

a DeviceConfigurationOverride that specifies the locales for the content under test.

Code Examples

DeviceConfigurationOverrideLocalesSample

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