User tests: Successful: Unsuccessful:
Formatting numeric values sometimes involves decimals separator and thousands separator.
A wide variety of formats exists in the world (see http://en.wikipedia.org/wiki/Thousands_separator#Digit_grouping), but currently Joomla only uses the North American format, where the decimals separator is a mark and the thousands separator is a comma (2,000.5 MB). For example, European format is the opposite (2.000,5 MB).
Even worse, this format is hardcoded into the code so that it can't be easily changed.
This contribute removes the constants "." and "," used along the Joomla code, and introduces the use of DECIMALS_SEPARATOR and THOUSANDS_SEPARATOR language strings, which will be localized by the language Teams.
Description | <p>Formatting numeric values sometimes involves decimals separator and thousands separator.<br> A wide variety of formats exists in the world (see <a href="http://en.wikipedia.org/wiki/Thousands_separator#Digit_grouping">http://en.wikipedia.org/wiki/Thousands_separator#Digit_grouping</a>), but currently Joomla only uses the American format, where the decimals separator is a mark and the thousands separator is a comma (2,000.5 MB). For example, European format is the opposite (2.000,5 MB).<br> Even worse, this format is hardcoded into the code so that it can't be easily changed.</p> <p>This contribute removes the constants "." and "," used along the Joomla code, and introduces the use of DECIMALS_SEPARATOR and THOUSANDS_SEPARATOR language strings, which will be localized by the language Teams.</p> | ⇒ | <p>Formatting numeric values sometimes involves decimals separator and thousands separator.<br> A wide variety of formats exists in the world (see <a href="http://en.wikipedia.org/wiki/Thousands_separator#Digit_grouping">http://en.wikipedia.org/wiki/Thousands_separator#Digit_grouping</a>), but currently Joomla only uses the American format, where the decimals separator is a mark and the thousands separator is a comma (2,000.5 MB). For example, European format is the opposite (2.000,5 MB).<br> Even worse, this format is hardcoded into the code so that it can't be easily changed.</p> <p>This contribute removes the constants "." and "," used along the Joomla code, and introduces the use of DECIMALS_SEPARATOR and THOUSANDS_SEPARATOR language strings, which will be localized by the language Teams.</p> <p>Tracker: <a href="http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33359&start=0">http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33359&start=0</a></p> |
Labels |
Added:
?
|
It's a pleasure. The tracker exists, an I've updated the first comment.
Unfortunately there is a problem with a test unit. I have omitted modifications on modal.php but the system probably have taken it from my previous pull request.
It seems that the test fails because the test itself doesn't accept thousands separator on Byte numbers. :(
The error is because you made a change to braries/cms/html/number.php
. Before it just rounded the number and you are now formatting it as well.
So either don't change that behavior here, or update the unit test as well.
Sorry, I'm not experienced. I've have tried to exclude the modifications to number.php but I am unable.
You can just revert the changes by copying from an original file and then commit that. This will remove the changes from this PR.
Unable to revert since I already deleted my fork.
I've just submitted another pull request: "Added support for localized numeric format, 3rd attempt"
Would you please be so kind to confirm if I submit it the right way? Thanks!
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-02-28 08:57:26 |
That's correct. The new PR passes the tests.
Here in Switzerland we usually even use
2'000,5 MB
Is there a tracker item for this? If not can you please create one and reference it here?
When testing: Make sure you add the two new strings to your language file, otherwise it will still use the english format from fallback.
Test success: After applying patch and adding the language strings I saw the changed format in the article version modal, the com_finder statistics view and the debug information (memory usage).
I don't know where the change in the cache helper class could be tested, but code looks good there as well.
Thanks for coding this!