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
Enforce western arabic numerals for Stats #17160
Conversation
You can test the WordPress changes on this Pull Request by downloading an installable build (wordpress-installable-build-pr17160-5e245d3.apk), or scanning this QR code: |
You can test the Jetpack changes on this Pull Request by downloading an installable build (jetpack-installable-build-pr17160-5e245d3.apk), or scanning this QR code: |
WordPress/src/main/java/org/wordpress/android/widgets/MaterialTextViewWithArabicNumerals.kt
Outdated
Show resolved
Hide resolved
I'm trying to figure out how to add the views from your screenshot to my Stats. On the emulator that I'm testing (Pixel 5, Api 28) the issue doesn't seem to be specific to I added a few more stats cards but couldn't yet replicate the ones in your screenshot:
I'll try with the Jetpack App |
I was able to reproduce the issue with the Jetpack App. Working on a fix |
Thank you for iterating on this @ovitrif
Sorry for not providing more info on my testing setup. I've tested on a Pixel 5 with Android 13 (API level 33). I wonder if this can be Android version specific.
That might be the case since I was replicating this on the first/insights screen. The other screens LGTM device-2022-09-15-172712.mp4 |
@antonis Thank you for testing this with the Jetpack app. There were indeed different views where we had to use the I've updated all views I could find on the Jetpack App
There was a special case I had to fix, this appears when going to the details of a stats card which has a different value than zero (see screenshot): In the view that appears when tapping the highlighted button, the text in the middle of the pie chart was decorated with Spans (it's a Previews:
I updated the testing steps and added a test case for the Jetpack App |
Awesome! Many thanks for your help on this PR Antonis I'll fix the conflicts in P.S. I've updated the milestone to |
Fixes Partially #17002 — Handles only the Stats screens and the Today Stats card on My Site Dashboard
This PR introduces a wrapper over
MaterialTextView
that enforces the use of Western Arabic numerals by replacing Eastern Arabic and Persian/Urdu numerals to their Western Arabic counterparts.This UI component was then applied to every stats widget which uses
MaterialTextView
and displays numerals.The purpose of this PR is to make sure we're always displaying Western Arabic numerals on the Stats screens, to mainly address the remark from the issue:
To test:
Me
→App Settings
→Interface Language
and selectArabic
.My Site
→Home
tabToday's Stats
card to be western arabic.Stats
& explore the first tab (Insights)Stats
tab (Days/Weeks/...)Me
→App Settings
→Interface Language
and selectArabic
.0
Totals
Preview Test Case 2 — Step 3
Note For easier understanding the screenshot is in English. Same result should be expected in Arabic.
Previews
Stats → Insights tab
Regression Notes
Potential unintended areas of impact
Unexpected, since we're only replacing Indo-Arabic and Persian/Urdu numerals with the normal (Western) Arabic numerals.
What I did to test those areas of impact (or what existing automated tests I relied on)
Tested manually in Chinese & English languages.
What automated tests I added (or what prevented me from doing so)
N/a, we're only touching the view layer with these changes.
PR submission checklist:
RELEASE-NOTES.txt
if necessary.