Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Currency formatting not respecting region/country-specific (sub-locale) specifications #80

Open
pchew-change opened this issue Aug 11, 2016 · 1 comment

Comments

@pchew-change
Copy link

pchew-change commented Aug 11, 2016

It seems like currency formatting, viz. currency symbol placement, is not respecting sub-locale specific formatting.

http://www.unicode.org/cldr/charts/29/by_type/numbers.number_formatting_patterns.html#53687a25c19b6481

The above shows a contrast between fr (#,##0.00 ¤) and fr_CH (¤ #,##0.00;¤-#,##0.00), and for a number of es sub-locales, specifically:

standard-currency English: ‹¤#,##0.00›

,##0.00 ¤ ·es·

¤ #,##0.00 ·es_AR· ·es_CO· ·es_UY·… ·all·others·
¤ #,##0.00;¤-#,##0.00 ·de_CH· ·en_CH· ·fr_CH· ·it_CH·
¤#,##0.00 ·en· ·es_419· ·es_GQ·
¤#,##0.00;¤-#,##0.00 ·es_CL· ·es_EC· ·es_VE·

,##0.00 ¤ ·fr·

¤ #,##0.00 … ·all·others·
¤ #,##0.00;¤-#,##0.00 ·de_CH· ·en_CH· ·fr_CH· ·it_CH·

but passing on country_code seems to not be able to specify the appropriate positioning.

Any ideas on how to properly access the sub-locale specific variants, without having to enable/support all of the locales? For instance, we're currently supporting es-419 and passing on country_codes in our params; fully enabling all sub-locales subsumed by es-419 would be a nightmare.

@camertron
Copy link
Collaborator

Hey @pchew-change, thanks for filing this. It looks like the dependency on twitter-cldr-rb hasn't been updated in a while, which is the reason for this discrepancy. A lot of progress has been made in the Ruby version of the library, but sadly that progress has not been ported to Javascript. It's difficult to keep everything in sync. The number resources specifically are pretty far out-of-date. I'm working slowly on bringing the Ruby version up-to-date with some backwards-incompatible stuff that changed in CLDR v26, which should mean we can upgrade to CLDR v29 pretty easily. After that, I'll look into a more sustainable way of porting changes from Ruby to Javascript (maybe using opal?). My time is pretty limited these days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants