mattinger
10/05/2022, 12:39 PM@RunWith(Parameterized::class)
class ScreenshotTest(val selectedLocale: Locale) {
@get:Rule
val paparazzi: Paparazzi = Paparazzi(
theme = "android:Theme.MaterialComponents.Light.NoActionBar",
deviceConfig = DeviceConfig.NEXUS_5.copy(softButtons = false, screenHeight = 3000),
renderingMode = SessionParams.RenderingMode.V_SCROLL
)
companion object {
@Parameterized.Parameters(name = "{0}")
@JvmStatic
fun locales() = listOf(
Locale("en", "US"),
Locale("es", "US"),
Locale("fr", "CA"),
Locale("it", "IT"),
)
}
}
But i’m having trouble getting the locale to change. I tried Locale.setDefault before calling paparazzi.snapshot, but that didn’t seem to have any effect. I’m still getting english strings.Zach Klippenstein (he/him) [MOD]
10/05/2022, 3:07 PM