patch / cldr-number-pm5

Localized number formatters using the Unicode CLDR
https://metacpan.org/pod/CLDR::Number
Other
8 stars 3 forks source link

add minimum grouping digits #36

Closed patch closed 8 years ago

patch commented 9 years ago

Minimum grouping digits were added to the spec in CLDR v26 (#33). LDML stores the related value as minimumGroupingDigits and we should add the minimum_grouping_digits attribute.

http://www.unicode.org/reports/tr35/tr35-numbers.html#Number_Elements

The minimumGroupingDigits can be used to suppress groupings below a certain value. This is used for languages such as Polish, where one would only write the grouping separator for values above 9999. The minimumGroupingDigits contains the default for the locale.

http://cldr.unicode.org/translation/numbering-systems

In some languages, the grouping separator is suppressed in certain cases. For example, see china-auf-wachstumskurs.gif, where there is a grouping separator in 12 080 but not in 4720. The minimumGroupingDigits determines what the default for a locale is.

bjakubski commented 9 years ago

Hi. I gut CLDR::Number as part of CPAN Pull Request Challenge for June (yeah, a bit late now). Not knowing about CLDR existence earlier I found it interesting and wanted to do a bit more than just some cosmetics/metadata improvements etc. Thanks for keeping TODO items available, that is great help. I want to take a stab at this task. While looking at how data CLDR::Number uses is generated I found out that data I should be interested in is actually not generated, but kept in template/base.tx Am I correct? Is there some way of re-generating that file? If no then is it worthwhile to add generation of that data into generate-cldr-data.pl ?

patch commented 9 years ago

Welcome to CLDR::Number, @bjakubski! Note that the master branch is currently in development (and has been for quite a while) to upgrade from CLDR 24 to 27, including templating and scripting out the upgrade to make it easier in the future. The stable CPAN branch is named cldr24. I've been adding new features to that for CPAN releases and then merging back into master. bin/generate-cldr-data.pl and bin/template/base.tx are both new files in master that have not been completed. I can provide more details later because I'm at work now, but wanted to let you know the current status.

bjakubski commented 9 years ago

Thanks for information! Going back to my question about template/base.tx - should data that is currently there be generated by generate-cldr-data (i.e. not be part of template)? Is it something I can attempt to work on without interfering with your work?

patch commented 9 years ago

The hardcoded data in $DATA within base.tx is only a temporary solution because I have not yet finished the code in generate-cldr-data.pl to generate it from the CLDR data. You’re welcome to make any changes in those files. I’m on vacation for another week and have no plans to work on it while I’m away, but am happy to answer any questions.

patch commented 8 years ago

@bjakubski: CLDR::Number v0.11 was just released, upgrading to CLDR v27.0.1, with the data now all (mostly) being generated from CLDR JSON using generate-cldr-data.pl. If you’re still interested in this task, it would be much easier now and I’m happy to provide additional tips on implementation; if not, no worries! Let me know though so I can either help you or (eventually) implement it myself. Thanks!