Skip to content

i18n: Add a RTL language #803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chrisbobbe opened this issue Jul 11, 2024 · 0 comments
Closed

i18n: Add a RTL language #803

chrisbobbe opened this issue Jul 11, 2024 · 0 comments
Labels
a-i18n Translation, localization, internationalization

Comments

@chrisbobbe
Copy link
Collaborator

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.

@chrisbobbe chrisbobbe added the a-i18n Translation, localization, internationalization label Jul 11, 2024
chrisbobbe added a commit to chrisbobbe/zulip-flutter that referenced this issue Jul 12, 2024
This will let us simplify how we simulate RTL in the emoji-reaction
widget tests, coming up.

Fixes: zulip#803
chrisbobbe added a commit to chrisbobbe/zulip-flutter that referenced this issue Jul 16, 2024
This will let us simplify how we simulate RTL in the emoji-reaction
widget tests, coming up.

Fixes: zulip#803
chrisbobbe added a commit to chrisbobbe/zulip-flutter that referenced this issue Jul 26, 2024
This will let us simplify how we simulate RTL in the emoji-reaction
widget tests, coming up.

Fixes: zulip#803
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-i18n Translation, localization, internationalization
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant