? Success

User tests: Successful: Unsuccessful:

avatar demis-palma
demis-palma
27 Feb 2014

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.

Tracker: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33359&start=0

avatar demis-palma demis-palma - open - 27 Feb 2014
avatar Bakual
Bakual - comment - 28 Feb 2014

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!

avatar wilsonge
wilsonge - comment - 28 Feb 2014

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)

avatar brianteeman
brianteeman - comment - 28 Feb 2014

I agree with @wilsonge the metadata is the correct place for this along with the weekdays data.

To be honest when I saw this PR I was surprised as I thought we already did this, but obviously not.

avatar Bakual
Bakual - comment - 28 Feb 2014

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.

avatar javigomez
javigomez - comment - 28 Feb 2014

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

avatar Bakual
Bakual - comment - 28 Feb 2014

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) :smile:

avatar demis-palma
demis-palma - comment - 28 Feb 2014

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.

avatar wilsonge
wilsonge - comment - 28 Feb 2014

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 :)

avatar Bakual
Bakual - comment - 28 Feb 2014

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 :smile:

avatar infograf768
infograf768 - comment - 2 Mar 2014

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.

avatar Bakual Bakual - reference | - 7 Apr 14
avatar Bakual Bakual - close - 7 Apr 2014
avatar Bakual
Bakual - comment - 7 Apr 2014

Merged into 3.3.
Thanks all who helped!

avatar Bakual Bakual - change - 7 Apr 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-04-07 07:53:00
avatar Bakual Bakual - close - 7 Apr 2014
avatar Bakual Bakual - reference | - 12 May 14

Add a Comment

Login with GitHub to post a comment