Opened 4 years ago

Closed 3 years ago

#18623 closed feature (patchwelcome)

Missing Arabic Numeric Shaping Support in Dojo

Reported by: AhmedMustafa Owned by:
Priority: undecided Milestone: 1.13
Component: Internationalization Version: 1.10.4
Keywords: Cc:
Blocked By: Blocking:

Description

Arabic and many other languages have classical shapes for digits "National Digits" that are different from the conventional Western Digits (European). From the Arabic user's point of view, Arabic-Indic numerals are the basic numerals used in almost all forms of documents such as most of government documents. Dojo should provide APIs which allow the end user to change the digits shapes from European to Arabic & vice versa.

Change History (7)

comment:1 Changed 4 years ago by bill

From the Arabic user's point of view, Arabic-Indic numerals are the basic numerals used in almost all forms of documents such as most of government documents.

Hmm, and yet sites like http://www.uqn.gov.sa/Pages/Default.aspx show lots of European digits. Why is that?

Dojo should provide APIs which allow the end user to change the digits shapes from European to Arabic & vice versa.

Pull request is at https://github.com/dojo/dojo/pull/158. The basic concept is functions that take strings, possibly containing digits, and do conversions between Arabic digits and European, possibly based on context.

While that might be useful in certain cases, I think it makes more sense to update methods like dojo/number.format() and dojo/currency.format() to properly emit Arabic digits in Arabic locales.

comment:2 in reply to:  1 Changed 4 years ago by AhmedMustafa

Replying to bill:

Hmm, and yet sites like http://www.uqn.gov.sa/Pages/Default.aspx show lots of European digits. Why is that?

There are many reasons for that. One of them is that your browser configurations /OS locale is not correctly configured to display Arabic-indic digits. https://support.mozilla.org/en-US/questions/776410. & this is a screen shot of the paper-based version of that website. http://meprinter.com/ar/images/Issue-121/umalqraool4546-1.jpg please notice that it contains Arabic-Indic digits only.

Another reason is that there is no numeric shaping support in the level of HTML & JavaScript?. And we are trying to implement that support & make it independent of the OS/browsers.


While that might be useful in certain cases, I think it makes more sense to update methods like dojo/number.format() and dojo/currency.format() to properly emit Arabic digits in Arabic locales.

That might be fine in case of digits. But what about strings containing a combination of digits & text ?

comment:3 Changed 4 years ago by bill

OK. Well, this feature seems like over-engineering to me. I don't think it's suitable for dojo core.

You mentioned that some browsers (FF?) already support this natively. I also see it mentioned for IE. I'd suggest that if users that want this functionality, they just use the native browser support.

comment:4 Changed 4 years ago by Adam Peller

see also #3809

comment:5 Changed 4 years ago by dylan

Component: GeneralInternationalization

comment:6 Changed 4 years ago by dylan

Milestone: tbd1.12

Obviously a significant amount of effort has gone into this patch, so I think we need to find a way to allow this to be included. If it's too large for all use cases, then I'd suggest we find a way to make it as an extension, though that seems difficult with it being embedded into the parser, which doesn't have a plugin mechanism. Perhaps wrap its inclusion in the parser and html via a has feature test? That way the code is only included if the application wants to include this feature?

comment:7 Changed 3 years ago by dylan

Resolution: patchwelcome
Status: newclosed

If we're ever going to land this, it needs to address the feedback from the ticket. Closing the ticket for now, as patchwelcome, feel free to re-open it once you've decided how to address the feedback from @bill please. Thanks!

Note: See TracTickets for help on using tickets.