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).
Currently the 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.
Rather than language strings would it be better to put this in the metadata for a language? (https://github.com/joomla/joomla-cms/blob/staging/administrator/language/en-GB/en-GB.xml#L12)
Rather than language strings would it be better to put this in the metadata for a language?
Not sure I agree. The metadata can't be overriden using the language manager, right?
Example: We use the german language pack in Switzerland, but the number format could differ a bit from Germany. With a language override it would be simple to change if I wanted. But not when it's metadata.
mmm overrides or metadata... that is a good question.
I would say metadata because it will solve the situation where german from Switzerland and german from Germany can be handled by different metadata in different language package: ge-GE, ge-SW (I don't know if this is the right iso code).
But the reality is that we have many countries using language packages from other countries, for example the es-ES is used in many countries that also speak spanish because there is not the localised packages for that specific country. Or lets imagine that the German speakers from Switzerland don't do their own package because the use the Germany one. For that specific cases it would be nice to be able to use the language override if there is the need...
mmm
Or lets imagine that the German speakers from Switzerland don't do their own package because the use the Germany one.
We don't have an own language pack (or at least I'm not aware) and use the one for Germany. And given my country, I would even expect those format options to be different in each canton (region)
Agree with Bakual.
Having this values fixed in the language is slight better, but not much different from the current behaviour.
I suggest to preserve the ability to customize that value.
If it differs by region - your still setting this language stuff for a full country anyhow so you're still in trouble. Having said that I guess it's down to what @infograf768 thinks :)
If it differs by region - your still setting this language stuff for a full country anyhow so you're still in trouble.
I don't have a problem doing that. It's my site, I can do whatever I want
I am in favor of letting strings be customised by the site admin through the Language overrides.
Example:
in French (France) we would use: 3 000,00
In French (Canada) they would use 3.000.00
Both would use fr-FR as language pack.
Merged into 3.3.
Thanks all who helped!
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-04-07 07:53:00 |
PR still is fine. Copying test comment from previous PR
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!