amnestywebsite / humanity-theme

The Amnesty International WordPress Humanity Theme
https://wordpresstheme.amnesty.org/
Other
38 stars 10 forks source link

Add Option for forcing thousand separator for stats counter block #440

Open Gentyspun opened 1 month ago

Gentyspun commented 1 month ago

Epic: https://github.com/amnestywebsite/humanity-theme/issues/417 Issue: https://github.com/amnestywebsite/humanity-theme/issues/5

Adds a checkbox to the localisation tab inside Theme Options that forces the use of thousand separators on the stats counter block.

Steps to test:

  1. Before checking out this branch, edit a post on /es/
  2. Insert a counter block and populate with a number > 999 but < 10,000
  3. Save and view the front end.
  4. Notice the number will have no thousand separator.
  5. Checkout this branch and run a build
  6. Go to es/wp-admin/admin.php?page=amnesty_localisation_options_page
  7. There should now be a checkbox for "Force Thousands Separator"
  8. Check this, and save.
  9. Now return to your counter block front end and refresh
  10. The number should now display with a thousand separator (e.g. 3.445 for Spanish)

Considerations:

Example: http://bigbite.im/v/Rl4WKF