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

Update more in-app Stats texts to always use western arabic numerals #17217

Merged
merged 9 commits into from
Oct 12, 2022

Conversation

ovitrif
Copy link
Contributor

@ovitrif ovitrif commented Sep 27, 2022

Fixes 20.8 beta-testing issues discovered on #17160 (which fixes partially #17002) [internal ref: p5T066-3Ak-p2#comment-13583]

Included fixes (see previews):

  1. "Total"-type cards: (I.e. Total Likes, Total Comments): Stats → Insights → Total Likes
  2. Dates in Line Chart: Stats → Insights → Views & Visitors
  3. "Value change" text above bar chart: Stats → Days / Weeks / Months ...

To test:

1️⃣ Test Case 1 : Jetpack / Wordpress App Stats
  1. Open the JP/WP App, Go to MeApp SettingsInterface Language and select Arabic.
  2. Go back to My Site → tap Stats & explore the first tab (Insights)
    • Expect all updated texts to use western arabic numbers (see preview 1 & 2).
  3. Go to any other Stats tab (Days/Weeks/...)
    • Expect The "value change" text to use western arabic numbers (see preview 3).

Previews

1. Text in "Total"-type cards
Before After
2. Views & Visitors chart dates
Before After
3. Value "change" text
Before After

Regression Notes

  1. Potential unintended areas of impact
    Texts using text view component that forces western arabic numerals.
    Updated texts for non-arabic languages.

  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    Manual testing — the changes are rather trivial, just exposing a former private method public and reusing it.
    In one instance (for the "value change" text) we're forcing LTR text direction — this text is expected to include only numbers and symbols.

  3. What automated tests I added (or what prevented me from doing so)
    N/a — PR consists of small UI changes.

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@ovitrif ovitrif changed the base branch from trunk to release/20.8 September 27, 2022 14:19
@AliSoftware
Copy link
Contributor

cc @ParaskP7 who will cover for me as Release Manager for WPAndroid while I'll be AFK the next 3 days. We might want to try to include that fix in the beta you planned on doing tomorrow (the one we usually do for L10n smoke-testing)

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Sep 27, 2022

WordPress📲 You can test these changes on WordPress by downloading wordpress-installable-build-pr17217-32cf991.apk
💡 Scan this QR code with your Android phone to download and install the APK directly on it.
AppWordPress
Build FlavorJalapeno
Build TypeDebug
Commit32cf991
Note: This installable build uses the JalapenoDebug build flavor, and does not support Google Login.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Sep 27, 2022

Jetpack📲 You can test these changes on Jetpack by downloading jetpack-installable-build-pr17217-32cf991.apk
💡 Scan this QR code with your Android phone to download and install the APK directly on it.
AppJetpack
Build FlavorJalapeno
Build TypeDebug
Commit32cf991
Note: This installable build uses the JalapenoDebug build flavor, and does not support Google Login.

…' into fix/20.8-western-arabic-numerals

# Conflicts:
#	WordPress/src/main/res/layout/stats_block_value_item.xml
@ovitrif ovitrif changed the base branch from release/20.8 to trunk September 27, 2022 14:45
@ovitrif ovitrif modified the milestones: 20.8 ❄️, 20.9 Sep 27, 2022
@ovitrif
Copy link
Contributor Author

ovitrif commented Sep 27, 2022

cc @ParaskP7 who will cover for me as Release Manager for WPAndroid while I'll be AFK the next 3 days. We might want to try to include that fix in the beta you planned on doing tomorrow (the one we usually do for L10n smoke-testing)

As mentioned internally (p5T066-3Ak-p2#comment-13594) imho there's really no reason to push this to 20.8 unless we're sure this would not complicate the normal release flow 😄

@ovitrif ovitrif modified the milestones: 20.9, 21.0 Sep 30, 2022
@ovitrif
Copy link
Contributor Author

ovitrif commented Sep 30, 2022

Moved this PR to the next milestone: 21.0

@ovitrif ovitrif requested a review from a team October 10, 2022 16:38
android:visibility="gone" />
android:visibility="gone"
tools:text="-7 (-100%)"
android:layoutDirection="ltr"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a request for a change. Just curious why we set the layout direction here 🤔

Copy link
Contributor Author

@ovitrif ovitrif Oct 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for raising the question @antonis 🙇

I noticed this view was placing the number sign inverted when using a RTL language, see screenshot:

non_ltr

This isn't the case in other places because we always have a prefix / suffix or the number is part of a longer string.

Upon further investigation it appears this happens only when the text of the view contains a number and any other characters except letters.

This seems to be the behavior of text views in RTL languages, though not consistent after we've introduced the changes to use western arabic numerals.

A few other explorations without setting android:layoutDirection="ltr":

Prefix word Suffix word

Conclusion: In order to maintain a consistent position of the number sign with the other places, this change was indeed needed 🙂.

At the time I was also using Wikipedia to check the topic and my understanding was that the negative sign is positioned to the right only for eastern arabic numerals.

Copy link
Contributor

@antonis antonis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @ovitrif 👍
I've tested the app on a Pixel 5 (Android 13) and everything worked ass expected. The code also LGTM 🎉
A couple of notes but nothing blocking for this PR to be merged:

@ovitrif
Copy link
Contributor Author

ovitrif commented Oct 11, 2022

Great work @ovitrif 👍
I've tested the app on a Pixel 5 (Android 13) and everything worked ass expected. The code also LGTM 🎉
A couple of notes but nothing blocking for this PR to be merged:

  1. We could add a release note (though this would seem duplicate to this)
  2. Do we need to set the layout direction here?

Thank you for reviewing & testing @antonis 🙇

  1. I'll add a new release note, this way we're more sure during beta testing we're focusing on the changes 🙇
  2. This view was behaving differently and it would only show the positivity sign (+/-) similar to the other views in RTL when setting the layout direction. I'll explain more in the code-related comment 👍

@ovitrif ovitrif merged commit 2885159 into trunk Oct 12, 2022
@ovitrif ovitrif deleted the fix/20.8-western-arabic-numerals branch October 12, 2022 15:53
@ovitrif ovitrif added the Stats label Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants