Wrong format number after updated to version WordPress 5.6
-
I have just updated WordPress from version 4.9.15 to version 5.6 and I have discovered that the counter on the main page displayed the thousands separator with comma (,) instead of dot (.) e.g. 4.500 became 4,500.
The number is got from the database and is displayed on the page (no calculating)
If I rolled back to version 4.9.15 the thousands separator is displayed as I expected as dot (.)
How can I fix the problem by setup or change some codes ?
Thanks in advance.
-
Please provide a link to a page on your site where we can see this. Thanks. Note: Your link will be public and we will not later remove it.
Here is my site in Vietnamese:
I used the plugin “Post Views Counter” to display 5 posts, that is viewed most.
I can unfortunately paste the snapshot, where the numbers are displayed comma (,) instead of dot (.), but you can scroll down and see them on the right column with the following numbers after the most viewed posts title. They are numbers: 3188, 2020, 1637, 1247 and 1224 in the parentheses with black color.
I found something in “class-wp-locale.php”, maybe here I will modify:
/* translators: $thousands_sep argument for https://www.php.net/number_format, default is ‘,’ */
$thousands_sep = __( ‘number_format_thousands_sep’ );// Replace space with a non-breaking space to avoid wrapping.
$thousands_sep = str_replace( ‘ ‘, ‘ ‘, $thousands_sep );$this->number_format[‘thousands_sep’] = ( ‘number_format_thousands_sep’ === $thousands_sep ) ? ‘,’ : $thousands_sep;
Hi, @funmelody
I used the plugin “Post Views Counter” to display 5 posts, that is viewed most.
I recommend asking at https://wordpress.org/support/plugin/post-views-counter/ so the plugin’s developers and support community can help you with this.
I found something in “class-wp-locale.php”, maybe here I will modify
It’s never a good idea to modify core wp files. That can cause more trouble.
Kind regards!
Hi @vladytimy,
I do not think there is bug in the plugin “Post Views Counter”.
As I wrote in my first post: “…. If I rolled back to version 4.9.15 the thousands separator is displayed as I expected as dot (.) …”
There is some changes in version 5.6 that affected to the thousands separator.
Hi @vladytimy,
Which WordPress version are you using ?
How the “Post Views Counter” displays the thousands separator “,” or “.” ?
Do any other numbers appear with the wrong use of comma and dot? If so, it’s a WP problem and should be run up that flagpole. If not, it’s a problem from that plugin and should be reported via the link above.
Hi @sterndata,
Do any other numbers appear with the wrong use of comma and dot?
I used only number in the plugin.
it’s a problem from that plugin and should be reported via the link above.
I tried to reinstall version 4.9.15 with the same plugin “Post Views Counter”
and the thousands separator is displayed as I expected as dot (.) so we can not say that is plugins bug.nonetheless, ask in that plugin’s forum. If it is a WP bug and not something specific to your site, then a lot of other folks will be having the problem.
To help, assume may be a plugin or theme conflict. Please attempt to disable all plugins, and use one of the default (Twenty*) themes. If the problem goes away, enable them one by one to identify the source of your troubles.
I will try your advice if it does not work, I will ask the plugin-forum.
Thanks.Hi @sterndata,
No answer from the plugin-support.
Post Views Counter supportPlease attempt to disable all plugins, and use one of the default (Twenty*) themes. If the problem goes away, enable them one by one to identify the source of your troubles.
Nothing help as you wrote.
I copied the backup WP 4.9.15 and it works fine as I expected.
There is obviously bug in WP 5.6After checking in “the back room”, I got the following info:
The comma is the default thousands separator in core, the language they are using hasn’t translated it in 5.6, so it’ll remain as a comma, I’m going to presume it’s been translated to a period in the 4.9 branch though
https://translate.wordpress.org/projects/wp/4.9.x/vi/default/?filters%5Bterm%5D=number_format_thousands_sep&filters%5Bterm_scope%5D=scope_any&filters%5Bstatus%5D=current_or_waiting_or_fuzzy_or_untranslated&filters%5Buser_login%5D=&filter=Apply+Filters&sort%5Bby%5D=priority&sort%5Bhow%5D=desc vs https://translate.wordpress.org/projects/wp/dev/vi/default/?filters%5Bterm%5D=number_format_thousands_sep&filters%5Bterm_scope%5D=scope_any&filters%5Bstatus%5D=current_or_waiting_or_fuzzy_or_untranslated&filters%5Buser_login%5D=&filter=Apply+Filters&sort%5Bby%5D=priority&sort%5Bhow%5D=desc yop, I was right
I see Vietnamese is only at 91% translation now as well, so this could be a great opportunity to encourage them to take part in translating it if the comma is incorrect :slightly_smiling_face:
So, it’s not a “bug”, but an incomplete translation.
Hi #vi team. I corrected the relevant string in WordPress core
number_format_thousands_sepshould be “translated” to “.”. For some 3-4 versions the source “placeholder” was just incorrectly copied to the Vietnamese translation.@funmelody All WordPress translations are made by volunteer resources. Unfortunately, the Vietnamese translation has a backlog where around 700 strings need to be translated (and approved by translation editors) before a new language pack can be generated for WordPress 5.6.
You’re more than welcome to add your contribution here: https://translate.wordpress.org/locale/vi/default/wp/dev/Before you start suggesting strings, there’s some information about style guide and glossary, etc, for WordPress translation to Vietnamese. Search for “Vietnamese” in https://make.wordpress.org/polyglots/handbook/translating/list-of-glossaries-per-locale/
You can also try and get in touch with any of the current General Translation Editors, listed in https://make.wordpress.org/polyglots/teams/?locale=vi and ask for advice. Quickest way would probably be if you join the global Slack team for WordPress contributors via https://make.wordpress.org/chat/ and also the Vietnamese Slack workspace; You’ll find more information in https://vi.wordpress.org/team/slack-wordpress-viet-nam/
PS! WordPress 5.4 is fully translated in Vietnamese, you’ll probably get a corrected translation there within a couple of hours.
We tried to complete 5.6 version as soon as possible, but our volunteer time seems not good enough belongs with many Gutenberg-specific words which we need to approve carefully.
– @khoipro
The topic ‘Wrong format number after updated to version WordPress 5.6’ is closed to new replies.