Skip to content

Commit a56e0cd

Browse files
committed
Use Arabic numerals instead of Indic ones for Arabic date translations.
Fixes #5213
1 parent 5a5208b commit a56e0cd

File tree

2 files changed

+24
-48
lines changed

2 files changed

+24
-48
lines changed

modules/system/assets/js/lang/lang.ar.js

+12-24
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ $.oc.langMessages['ar'] = $.extend(
99
);
1010

1111
//! moment.js locale configuration v2.22.2
12+
//!!! IMPORTANT - modified from default - see https://github.com/octobercms/october/issues/5213
1213

1314
;(function (global, factory) {
1415
typeof exports === 'object' && typeof module !== 'undefined'
@@ -19,27 +20,16 @@ $.oc.langMessages['ar'] = $.extend(
1920

2021

2122
var symbolMap = {
22-
'1': '١',
23-
'2': '٢',
24-
'3': '٣',
25-
'4': '٤',
26-
'5': '٥',
27-
'6': '٦',
28-
'7': '٧',
29-
'8': '٨',
30-
'9': '٩',
31-
'0': '٠'
32-
}, numberMap = {
33-
'١': '1',
34-
'٢': '2',
35-
'٣': '3',
36-
'٤': '4',
37-
'٥': '5',
38-
'٦': '6',
39-
'٧': '7',
40-
'٨': '8',
41-
'٩': '9',
42-
'٠': '0'
23+
'1': '1',
24+
'2': '2',
25+
'3': '3',
26+
'4': '4',
27+
'5': '5',
28+
'6': '6',
29+
'7': '7',
30+
'8': '8',
31+
'9': '9',
32+
'0': '0'
4333
}, pluralForm = function (n) {
4434
return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;
4535
}, plurals = {
@@ -124,9 +114,7 @@ $.oc.langMessages['ar'] = $.extend(
124114
yy : pluralize('y')
125115
},
126116
preparse: function (string) {
127-
return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
128-
return numberMap[match];
129-
}).replace(/،/g, ',');
117+
return string.replace(/،/g, ',');
130118
},
131119
postformat: function (string) {
132120
return string.replace(/\d/g, function (match) {

modules/system/assets/ui/vendor/moment/locale/ar.js

+12-24
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//! moment.js locale configuration v2.22.2
2+
//!!! IMPORTANT - modified from default - see https://github.com/octobercms/october/issues/5213
23

34
;(function (global, factory) {
45
typeof exports === 'object' && typeof module !== 'undefined'
@@ -9,27 +10,16 @@
910

1011

1112
var symbolMap = {
12-
'1': '١',
13-
'2': '٢',
14-
'3': '٣',
15-
'4': '٤',
16-
'5': '٥',
17-
'6': '٦',
18-
'7': '٧',
19-
'8': '٨',
20-
'9': '٩',
21-
'0': '٠'
22-
}, numberMap = {
23-
'١': '1',
24-
'٢': '2',
25-
'٣': '3',
26-
'٤': '4',
27-
'٥': '5',
28-
'٦': '6',
29-
'٧': '7',
30-
'٨': '8',
31-
'٩': '9',
32-
'٠': '0'
13+
'1': '1',
14+
'2': '2',
15+
'3': '3',
16+
'4': '4',
17+
'5': '5',
18+
'6': '6',
19+
'7': '7',
20+
'8': '8',
21+
'9': '9',
22+
'0': '0'
3323
}, pluralForm = function (n) {
3424
return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;
3525
}, plurals = {
@@ -114,9 +104,7 @@
114104
yy : pluralize('y')
115105
},
116106
preparse: function (string) {
117-
return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
118-
return numberMap[match];
119-
}).replace(/،/g, ',');
107+
return string.replace(/،/g, ',');
120108
},
121109
postformat: function (string) {
122110
return string.replace(/\d/g, function (match) {

0 commit comments

Comments
 (0)