-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Themes: Nicely format the matching count #7462
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
base: trunk
Are you sure you want to change the base?
Conversation
The theme navigation includes a count of themes matching the current query. It's currently displayed as a straight number e.g. "6916". It is slightly nicer if the number is displayed with a locale-specific thousands separator.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @rcrdortiz. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
|
||
| renderThemeCount: function( count ) { | ||
| this.liveThemeCount = count; | ||
| const currentLocale = document.documentElement.lang; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the standards the correct way in Spanish is to only group thousands if the number is greater than or equal to 10000. See https://st.unicode.org/cldr-apps/v#/es/Symbols/70ef5e0c9d323e01
Checking, and this bears out, if I run:
const n = 8456;
console.log(
n.toLocaleString('en'),
n.toLocaleString('es'),
n.toLocaleString('es-es'),
n.toLocaleString('es-mx'),
);
I get: "8,456", "8456", "8456", "8,456" i.e. Spanish from Spain has no thousands separator
If I run:
const n = 98456;
console.log(
n.toLocaleString('en'),
n.toLocaleString('es'),
n.toLocaleString('es-es'),
n.toLocaleString('es-mx'),
);
I get: "98,456", "98.456", "98.456", "98,456" i.e. a thousands separator is present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the standards the correct way in Spanish is to only group thousands if the number is greater than or equal to 10000
TIL!


The theme navigation includes a count of themes matching the current query. It's currently displayed as a straight number e.g. "6916". It is slightly nicer if the number is displayed with a locale-specific thousands separator.
Trac ticket: https://core.trac.wordpress.org/ticket/62138
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.