{"action":"created","issue":{"url":"https://api.github.com/repos/jquery/globalize/issues/553","labels_url":"https://api.github.com/repos/jquery/globalize/issues/553/labels{/name}","comments_url":"https://api.github.com/repos/jquery/globalize/issues/553/comments","events_url":"https://api.github.com/repos/jquery/globalize/issues/553/events","html_url":"https://github.com/jquery/globalize/pull/553","id":117465842,"number":553,"title":"Arabic Numeric Shaping Support","user":{"login":"AhmedMustafa","id":7556286,"avatar_url":"https://avatars.githubusercontent.com/u/7556286?v=3","gravatar_id":"","url":"https://api.github.com/users/AhmedMustafa","html_url":"https://github.com/AhmedMustafa","followers_url":"https://api.github.com/users/AhmedMustafa/followers","following_url":"https://api.github.com/users/AhmedMustafa/following{/other_user}","gists_url":"https://api.github.com/users/AhmedMustafa/gists{/gist_id}","starred_url":"https://api.github.com/users/AhmedMustafa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AhmedMustafa/subscriptions","organizations_url":"https://api.github.com/users/AhmedMustafa/orgs","repos_url":"https://api.github.com/users/AhmedMustafa/repos","events_url":"https://api.github.com/users/AhmedMustafa/events{/privacy}","received_events_url":"https://api.github.com/users/AhmedMustafa/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jquery/globalize/labels/CLA:%20Valid","name":"CLA: Valid","color":"007700"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-11-17T22:26:16Z","updated_at":"2015-11-30T10:52:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jquery/globalize/pulls/553","html_url":"https://github.com/jquery/globalize/pull/553","diff_url":"https://github.com/jquery/globalize/pull/553.diff","patch_url":"https://github.com/jquery/globalize/pull/553.patch"},"body":"### Introduction to Arabic Numeric Shaping\r\n\r\nArabic and many other languages (Thai and Bengali) have classical shapes for digits “National Digits” that are different from the conventional Western Digits (European).\r\n\r\nNational digits have the same semantic meaning as the European digits, and the numbers they form are read from left to right (most significant digit on the left). The difference is only a difference in glyphs.\r\n\r\n| European Digits | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |\r\n| --------------- |----|---|---|---|---|---|---|---|---|---|\r\n| **Arabic-Indic Digits** | ٠ |\t١ |\t٢ |\t٣ |\t٤ |\t٥ |\t٦ |\t٧ |\t٨ |\t٩ |\r\n\r\n\r\nFrom 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 (IDs, birth certificates, driver's licenses, passports and household bills), bank statements, newspapers, calendars, road signs and menus.\r\n\r\n<br>\r\n\r\n### Options for Arabic Numeric Shaping\r\n\r\nThere are 3 options which should be taken into consideration when implementing national numeric shaping support in any framework/technology. These options are:\r\n\r\n- **None**: No shaping is performed, and the value appears as it is in the data source.\r\n- **National**: Digit shapes are determined from the user’s language.\r\n- **Contextual**: Digit shapes are determined from the preceding characters in the buffer. European digits follow strong Latin character and Arabic-Indic digits follow strong Arabic character.\r\nWhen there is no preceding strong characters, the base text direction attribute determines the digit shaping.(Arabic-Indic digits in RTL context and European digits in LTR context).\r\n\r\n\r\n|**Pseudo Sample** | 123 abc 456 *ARABIC* 789 |\r\n| -----------------|:-------------------------|\r\n|**Arabic Sample** | 123 abc 456 أبجد 789|\r\n|**Sample Buffer** |![sample buffer](https://raw.githubusercontent.com/ACGC/national_numeric_shaping_draft/master/images/buff.png)|\r\n\r\n| Option | LTR Context | RTL Context |\r\n| ------------ |----------|----------|\r\n| None | ![](https://raw.githubusercontent.com/ACGC/national_numeric_shaping_draft/master/images/01.png) | Same as LTR. |\r\n| Contextual | ![](https://raw.githubusercontent.com/ACGC/national_numeric_shaping_draft/master/images/02.png) | ![](https://raw.githubusercontent.com/ACGC/national_numeric_shaping_draft/master/images/03.png) |\r\n| National | ![](https://raw.githubusercontent.com/ACGC/national_numeric_shaping_draft/master/images/04.png) | Same as LTR |\r\n<br>\r\n\r\n### Problem Statement\r\n\r\nMost of the available frameworks/technologies lack the contextual shaping option of national digits. Contextual digit shaping is a very important feature as the Arabic users don’t expect to see Arabic-Indic numerals or European numerals only when they have mixed English and Arabic data. \r\n\r\nFor example if a document has many paragraphs some in Arabic and others in English, in the Arabic paragraphs the Arabic users expect to see national or Arabic-Indic numerals, and in the English paragraphs the Arabic users expect to see European numerals.\r\n\r\nSince the mixed English and Arabic data cases are very common in Arabic region, the same case with numerals is very common too.\r\n\r\n| ![Figure 1](https://raw.githubusercontent.com/ACGC/national_numeric_shaping_draft/master/images/fig1.png) |\r\n|:--------------------------------:|\r\n|Figure 1: Sample communication thread using IBM Lotus Notes|\r\n\r\n|![Figure 2](https://raw.githubusercontent.com/ACGC/national_numeric_shaping_draft/master/images/fig2.png)|\r\n|:----------------------------:|\r\n|Figure 2: Sample Arabic and English list of references.|\r\n\r\nArabic paragraphs that list references’ names(which include numerals) are very common for Arabic users as well. In that case the Arabic users expect to see the numerals as European not Arabic-Indic.\r\n\r\n|![Figure 3](https://raw.githubusercontent.com/ACGC/national_numeric_shaping_draft/master/images/fig3.png)|\r\n|:----------------------------:|\r\n|Figure 3: Sample Arabic paragraph where users expect to see European numerals.|\r\n<br>\r\n\r\n**_So direct conversion of digits from latin to national will not fulfil Arabic users’ needs.\r\nContextual behavior is the core numeric shaping option that is needed from the Arabic users’ point of view._**\r\n<br> "},"comment":{"url":"https://api.github.com/repos/jquery/globalize/issues/comments/160596339","html_url":"https://github.com/jquery/globalize/pull/553#issuecomment-160596339","issue_url":"https://api.github.com/repos/jquery/globalize/issues/553","id":160596339,"user":{"login":"tomerm","id":5329257,"avatar_url":"https://avatars.githubusercontent.com/u/5329257?v=3","gravatar_id":"","url":"https://api.github.com/users/tomerm","html_url":"https://github.com/tomerm","followers_url":"https://api.github.com/users/tomerm/followers","following_url":"https://api.github.com/users/tomerm/following{/other_user}","gists_url":"https://api.github.com/users/tomerm/gists{/gist_id}","starred_url":"https://api.github.com/users/tomerm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomerm/subscriptions","organizations_url":"https://api.github.com/users/tomerm/orgs","repos_url":"https://api.github.com/users/tomerm/repos","events_url":"https://api.github.com/users/tomerm/events{/privacy}","received_events_url":"https://api.github.com/users/tomerm/received_events","type":"User","site_admin":false},"created_at":"2015-11-30T10:52:53Z","updated_at":"2015-11-30T10:52:53Z","body":"Thanks. My intention was to say that we will leverage #503 (unless you believe it is better to open a new PR) to suggest how current support in Globalize (for number formatting based on different numeric numbering systems) can be extended to support algorithmic numbering systems such as Hebrew mentioned in #537 ."}}