Use Arabic numerals instead of Indic ones for Arabic date translations.

Fixes #5213
This commit is contained in:
Luke Towers 2020-07-19 01:15:07 -06:00
parent 5a5208bd0b
commit a56e0cdf61
2 changed files with 24 additions and 48 deletions

View File

@ -9,6 +9,7 @@ $.oc.langMessages['ar'] = $.extend(
);
//! moment.js locale configuration v2.22.2
//!!! IMPORTANT - modified from default - see https://github.com/octobercms/october/issues/5213
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
@ -19,27 +20,16 @@ $.oc.langMessages['ar'] = $.extend(
var symbolMap = {
'1': '١',
'2': '٢',
'3': '٣',
'4': '٤',
'5': '٥',
'6': '٦',
'7': '٧',
'8': '٨',
'9': '٩',
'0': '٠'
}, numberMap = {
'١': '1',
'٢': '2',
'٣': '3',
'٤': '4',
'٥': '5',
'٦': '6',
'٧': '7',
'٨': '8',
'٩': '9',
'٠': '0'
'1': '1',
'2': '2',
'3': '3',
'4': '4',
'5': '5',
'6': '6',
'7': '7',
'8': '8',
'9': '9',
'0': '0'
}, pluralForm = function (n) {
return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;
}, plurals = {
@ -124,9 +114,7 @@ $.oc.langMessages['ar'] = $.extend(
yy : pluralize('y')
},
preparse: function (string) {
return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
return numberMap[match];
}).replace(/،/g, ',');
return string.replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {

View File

@ -1,4 +1,5 @@
//! moment.js locale configuration v2.22.2
//!!! IMPORTANT - modified from default - see https://github.com/octobercms/october/issues/5213
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
@ -9,27 +10,16 @@
var symbolMap = {
'1': '١',
'2': '٢',
'3': '٣',
'4': '٤',
'5': '٥',
'6': '٦',
'7': '٧',
'8': '٨',
'9': '٩',
'0': '٠'
}, numberMap = {
'١': '1',
'٢': '2',
'٣': '3',
'٤': '4',
'٥': '5',
'٦': '6',
'٧': '7',
'٨': '8',
'٩': '9',
'٠': '0'
'1': '1',
'2': '2',
'3': '3',
'4': '4',
'5': '5',
'6': '6',
'7': '7',
'8': '8',
'9': '9',
'0': '0'
}, pluralForm = function (n) {
return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;
}, plurals = {
@ -114,9 +104,7 @@
yy : pluralize('y')
},
preparse: function (string) {
return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
return numberMap[match];
}).replace(/،/g, ',');
return string.replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {