Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

Gentyspun
Copy link
Contributor

Epic: #417
Issue: #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:

  • Localisation

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

jaymcp
jaymcp previously requested changes Dec 3, 2024
Copy link
Contributor

@jaymcp jaymcp left a comment

Choose a reason for hiding this comment

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

This works well, thanks. I would recommend perhaps appending to an existing window property that we add, rather than creating a new one. I'd also rename it from forceTS, because it's not very clear what that means.

private/src/scripts/modules/counter.js Outdated Show resolved Hide resolved
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants