WordPress-Android icon indicating copy to clipboard operation
WordPress-Android copied to clipboard

Percent sign should be localized

Open irfano opened this issue 3 years ago • 1 comments

Expected behavior

Shortly, the percent sign should be localized according to the current language's rules.

The percentage symbol % should be at the start of the number (%100) in some languages (Turkish, Arabic), and the end of the number (100%) in some languages (English, French...). There are also rules for spacing between the sign and the number that can be checked over: https://en.wikipedia.org/wiki/Percent_sign#Form_and_spacing

Strings which has percent sign: <string name="stats_traffic_increase">+%1$s (%2$s%%)</string> <string name="stats_traffic_change">%1$s (%2$s%%)</string> <string name="scan_progress_label" translatable="false">%1$s%%</string> <string name="stats_most_popular_percent_views">%1$d%% of views</string> <string name="backup_download_progress_label">%1$s%%</string> <string name="restore_progress_label">%1$s%%</string>

WordPress.com in Turkish: Screen Shot 2022-05-07 at 13 28 05

Actual behavior

The percent sign is the end of the number in Turkish. Screenshot_20220507-132025

Steps to reproduce the behavior

  1. Change your device language to Turkish from OS settings. Settings navigation can change according to your device, but it's easier to search the "language" keyword in settings.
  2. Open WordPress app.
  3. Go to stats either using quick links or menu.
  4. Switch to DAYS ("GÜNLER" in Turkish) tab.
  5. Check the percent sign and notice it's the end of the number instead of the start.
Tested on Galaxy S22, Android 12, WPAndroid 19.7.1 (1211)

irfano avatar May 07 '22 10:05 irfano

NumberFormatter can be used for localization.

irfano avatar May 07 '22 10:05 irfano