-
Notifications
You must be signed in to change notification settings - Fork 346
Closed
Labels
a-i18nTranslation, localization, internationalizationTranslation, localization, internationalization
Description
If we add an RTL language to our supported locales—even if it has no translations yet—then widget tests exercising RTL can build ZulipApp without having to add an ad-hoc Directionality. They would do this by simulating the system language setting. For example in test/widgets/emoji_reaction_test.dart, in a test helper with a textDirection param:
+ final locale = switch (textDirection) {
+ TextDirection.ltr => const Locale('en'),
+ TextDirection.rtl => const Locale('ar'),
+ };
+ tester.platformDispatcher.localeTestValue = locale;
+ tester.platformDispatcher.localesTestValue = [locale];
+ addTearDown(tester.platformDispatcher.clearLocaleTestValue);
+ addTearDown(tester.platformDispatcher.clearLocalesTestValue);
+
+ await tester.pumpWidget(const ZulipApp());
+ // [etc.]If ar isn't in the supported locales, though, ZulipApp understandably acts just as it would in the wild, when ar is selected in system settings: it falls back to English.
gnprice
Metadata
Metadata
Assignees
Labels
a-i18nTranslation, localization, internationalizationTranslation, localization, internationalization
Type
Projects
Status
Done