Skip to content
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

Use Arabic numerals consistently #17002

Open
thehenrybyrd opened this issue Aug 4, 2022 · 7 comments
Open

Use Arabic numerals consistently #17002

thehenrybyrd opened this issue Aug 4, 2022 · 7 comments

Comments

@thehenrybyrd
Copy link
Contributor

thehenrybyrd commented Aug 4, 2022

Expected behavior

Arabic numerals (1 2 3 4 5 6 7 8 9 0) should be used everywhere all the time.

Actual behavior

When Arabic is the selected app language, in a number of places, but not consistently, we use Indo-Arabic numerals instead of normal Arabic numerals. We would do better to consistently use Arabic numerals (the regular ones we’re used to) rather than Eastern Arabic (Indo-Arabic) numerals – (٠ ١ ٢ ٣ ٤ ٥ ٦ ٧ ٨ ٩) – because everyone who reads Arabic knows the Arabic numerals, but not all know the Indo-Arabic numerals.

This looks especially strange on screens where we use both types of numerals:

Steps to reproduce the behavior

  1. Head to Me > App Settings > Interface Language and select Arabic.
  2. Explore the app and find the Eastern Arabic numerals displayed in various places.
    I've seen them in the Stats Card and Screens, Blogging Prompts Card, while selecting Media, and in Reader (dates)
Tested on Samsung Galaxy S21, Android 12, WPAndroid 20.4-rc-2
Internal reference: p5T066-3jv-p2#comment-12698
@ovitrif
Copy link
Contributor

ovitrif commented Sep 14, 2022

I've investigated the issue and for me the behaviour is a bit different.

All numbers on the stats screen are displayed in Indo-Arabic for me:

From this StackOverflow answer I understood that there was an issue filed for the Android code. Unfortunately the link to the issue doesn't work for me, saying I'm denied access (tried with 1 e-mail addresses), so I couldn't check what's going on behind the scenes and what is the latest status update on it.

While continuing to investigate the issue I've discovered another strange thing, related to the time formatting for the "best hour".

When changing the app language to Arabic and looking at the stats → insights tab, the hour is displayed and formatted with Indo-Arabic digits, as seen in the screenshot above.

If I close the app and open it again (thus the initial locale on app start is Arabic), the hour is formatted with Western Arabic numbers, and the AM/PM is shown in English:

I've started working on a fix for the original issue, but I won't be addressing this newly discovered problem in that fix, since it proves to be a different issue, which probably has its root cause in the localization system we're using. There's currently progress on updating that.

@ovitrif
Copy link
Contributor

ovitrif commented Sep 16, 2022

This PR fixes the issue for Stats: #17160

We can apply the same approach introduced in that PR to all other places where we're displaying numerals on the UI, the solution in that PR is easily applicable in most cases; it should be fairly simple to reuse it.

The task of finding all such places is quite complex though :)

@thehenrybyrd
Copy link
Contributor Author

thehenrybyrd commented Sep 19, 2022

@ovitrif thanks so much for working on this!

I won't be addressing this newly discovered problem in that fix, since it proves to be a different issue, which probably has its root cause in the localization system we're using.

Yeah, that seems quite likely. I think our primary concern should be to make sure everything looks as it should using the device language settings.

The task of finding all such places is quite complex though :)

Fair point! We could do a physical device audit to look for these numerals on all screens. I wonder though, is there a class or type based strategy we could use to find all such places in the codebase?

@ovitrif
Copy link
Contributor

ovitrif commented Sep 20, 2022

Yeah, that seems quite likely. I think our primary concern should be to make sure everything looks as it should using the device language settings.

I agree, thank you @thehenrybyrd 🙇 !

I wonder though, is there a class or type based strategy we could use to find all such places in the codebase?

That would be great indeed but it might not work in this case according to my current knowledge of the issue. We could in principle replace all usages of text views and their derivatives (MaterialTextView, WPTextView) but that might be an even bigger chunk of work that feels a bit dangerous considering the amount of testing we should be doing to make sure new bugs don't slip through.

We could do a physical device audit to look for these numerals on all screens.

In all fairness my current understanding tells me this might be the best approach to fix the issue in all places. There's definitely a big amount of work required for this, but with this approach we're sure to limit the changes to what's needed 👍

@thehenrybyrd
Copy link
Contributor Author

@ovitrif that makes sense to me! This isn't high enough priority for an audit currently, but I'll keep reporting other instances when I run across them. Thanks for fixing this for stats!

@ovitrif
Copy link
Contributor

ovitrif commented Sep 27, 2022

Upon beta-testing the fixes for the in-app Stats, we've found another place where Eastern Arabic numerals should be replaced with Western Arabic ones:

  • Stats Widgets (internal ref: p5T066-3Ak-p2#comment-13587)

@thehenrybyrd
Copy link
Contributor Author

Another place we're using Eastern Arabic numerals is in the Blogging Prompts card (and in the FAB), where we state how many people have replied to a prompt, with "# answers".

@ovitrif ovitrif removed their assignment May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants