Skip to content

Currency: support symbol-alt-narrow #479

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

Closed
Renkas opened this issue Aug 9, 2015 · 15 comments
Closed

Currency: support symbol-alt-narrow #479

Renkas opened this issue Aug 9, 2015 · 15 comments

Comments

@Renkas
Copy link

Renkas commented Aug 9, 2015

CLDR exposes also symbol-alt-narrow for some currencies (since CLDR 24: http://cldr.unicode.org/index/downloads/cldr-24)

Example in 'et' locale Globalize.currencyFormatter( "PLN" )( 1 ) - outputs:
1,00 PLN

With symbol-alt-narrow support the output should be:
1,00 zł

@rxaviers
Copy link
Member

CLDR indeed has the data. But, it doesn't specify how to use it. This same topic has been discussed in tc39/ecma402#4. So, the first step is to define how this could be supported.

I recommend researching CLDR tickets (e.g., http://unicode.org/cldr/trac/search?changeset=on&milestone=on&ticket=on&wiki=on&q=symbol+alt&page=2&noquickjump=1) and its documentation (http://www.unicode.org/reports/tr35/tr35-numbers.html#Currencies) to find substance to elaborate a suggestion. Perhaps, a variant subtag could be specified in the locale to define the preference for the alt symbol. Perhaps, an additional option on the currencyFormatter could be specified. Either way, I suggest that whatever is considered here should be aligned with CLDR.

@Renkas
Copy link
Author

Renkas commented Aug 10, 2015

For my purpose an additional option for the currencyFormatter() would be sufficient.

Quote from the change log:

The narrow forms are intended to be as narrow as possible, however, there may be no good narrow term for some units in some languages. As always, narrow forms are not necessary unique; they should only be used where the context is sufficiently clear (eg, it is a length).

I think that adding an option named 'narrow' to currencyFormatter() would then do exactly what it's meant to. I think that would be the perfect place as the usage is context sensitive. It wouldn't make sense to make it global option.

@rxaviers
Copy link
Member

A {form: "narrow"} option sounds good to me. Basically, it should try symbol-alt-narrow || symbol given narrow is not available for all currencies.

Given the change log makes reference for the narrow form. But, http://www.unicode.org/reports/tr35/tr35-numbers.html#Currencies does not. I believe we should request it to be inlcuded by filing a ticket on CLDR (http://unicode.org/cldr/trac/) as a preliminary step. If you agree, please do so and add a new comment here with the ticket number. I will help bringing this to focus on the CLDR committee.

@Renkas
Copy link
Author

Renkas commented Aug 10, 2015

There seems to be already a ticket: http://unicode.org/cldr/trac/ticket/8461

@rxaviers
Copy link
Member

It's targeted for CLDR 28, so we could give the implementation a try. Basically, what needs update is:

Feel free to submit a Pull Request. :)

@Renkas
Copy link
Author

Renkas commented Aug 10, 2015

I'll better leave this to someone who knows what he is doing :)

Anyway thanks in advance - can't wait to use this.

@rxaviers rxaviers changed the title add symbol-alt-narrow support to currencyFormatter Currency: support symbol-alt-narrow Oct 10, 2015
@zolitch
Copy link

zolitch commented Feb 23, 2016

Looks like this has now been added to the spec: http://unicode.org/cldr/trac/ticket/8405#comment:7

Is there any movement here or is someone working on an implementation? It would be great to get this feature!

@rxaviers
Copy link
Member

Hey @zolitch, no one seems to be working on it, but I believe it's a quick change. Would you be interested in implementing it? Just let me know if you have any questions? Thanks

@zolitch
Copy link

zolitch commented Feb 24, 2016

I can't right now but can do if I get some time over the next week or. Provided a workaround on the project I'm working on right now.

@sreekanthjnayar
Copy link

Has this been integrated into the current version? Would be a useful feature to have, any ETA on this.

@rxaviers
Copy link
Member

Hi @sreekanthjnayar thanks for your interest. The implementation is close to complete, it misses some review fixes #631 (which stalled). Would you be interested in moving forward with this work (see #631)? Just let me know if you have any questions? Thanks

rxaviers pushed a commit to rxaviers/globalize that referenced this issue May 29, 2017
Adds support for alternative symbols via 'symbolForm' option

Ref globalizejs#479
rxaviers added a commit to rxaviers/globalize that referenced this issue May 29, 2017
@rxaviers
Copy link
Member

This change is technically ready to merge. It's waiting on Foundation matters.

rxaviers pushed a commit to rxaviers/globalize that referenced this issue May 30, 2017
Adds support for alternative symbols via 'symbolForm' option

Ref globalizejs#479
rxaviers added a commit to rxaviers/globalize that referenced this issue May 30, 2017
@kborchers
Copy link
Contributor

This is good to go as you can see in #738 which shows all checks passing, including @gethinwebster's signature which I have also verified is in the database.

@rxaviers
Copy link
Member

Yeap. Thanks... @gethinwebster has re-signed it.

@mihaellenic
Copy link

When could this be merged into master? It looks like there are no blockers.
I would like to use this feature very much. :)

rxaviers pushed a commit to rxaviers/globalize that referenced this issue Jul 17, 2018
Adds support for alternative symbols via 'symbolForm' option

Ref globalizejs#479
Ref globalizejs#631
Ref globalizejs#738
rxaviers added a commit to rxaviers/globalize that referenced this issue Jul 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants