sergio-sastre / AndroidUiTestingUtils

A set of TestRules, ActivityScenarios and utils to facilitate UI and screenshot testing under given configurations: FontSizes, Locales...
MIT License
290 stars 14 forks source link

Complex locales are not supported #16

Closed sergio-sastre closed 1 year ago

sergio-sastre commented 1 year ago

Describe the bug Complex locales, like "sr-Latn-RS" / "sr-Cyrl-RS" or "zh-Latn-TW-pinyin" cannot be set.

Environment The setup in which the bug is reproducible:

Expected behavior The locale should also be set correctly for those languages

Additional context All the methods/components to set the Locale use the same methods as fastlane/Screengrab for converting strings into Locales. It means, they do not use Locale.forLanguageTag(), which supports such complex locales, but its own Localeutil method. It is worth noticing that Locale.forLanguageTag() only supports IETF locale strings e.g. "en-US" but not ISO locale strings e.g. "en_US".

Moreover, the pseudolocales "en_XA" and "ar_XB" only exist as ISO locale Strings.

That is important to add support for complex locales, while still supporting ISO locales (at least as good as till AndroidUiTestingUtils 1.2.1) as well as pseudolocales

sergio-sastre commented 1 year ago

Fix in 1.2.2