blib/lib/AmberDB/Locale/Lang/ar.pm untested

filter: Statementstmt 0.0% 0 / 22 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 27 CC 1 SCAR 6.9
CC
1
Cov
0%
data
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package AmberDB::Locale::Lang::ar;
2
3 use 5.016;
4 use warnings;
5 use utf8;
6
7 our $VERSION = '5.26.6';
8 my $CREATED = '2026-07-23';
9
10 # -------------------------------------------------------
11 # Arabic locale data for AmberDB::Locale.
12 # Pure data module — no logic.
13 # -------------------------------------------------------
14 sub data {
15 return {
16 uc_map => {},
17 lc_map => {},
18 regex_map => {},
19 phonetic_map => [
20 [ "[\x{0622}\x{0623}\x{0625}]" => "\x{0627}" ], # أ, إ, آ → ا (Alef variants)
21 [ "\x{0629}\$" => "\x{0647}" ], # ة → ه (Ta Marbuta)
22 [ "\x{0649}\$" => "\x{064A}" ], # ى → ي (Alif Maqsurah)
23 ],
24 sort_map => {},
25
26 # Arabic characters range (U+0600 to U+06FF) + Eastern Arabic numerals
27 alphabet_chars => "\x{0600}-\x{06FF}",
28
29 accent_map => {},
30
31 # Arabic to Latin ASCII transliteration (SATTS / Buckwalter style)
32 ascii_map => {
33 "\x{0621}" => 'a', # أ
34 "\x{0627}" => 'a', # ا
35 "\x{0628}" => 'b', # ب
36 "\x{062A}" => 't', # ت
37 "\x{062B}" => 'th', # ث
38 "\x{062C}" => 'j', # ج
39 "\x{062D}" => 'h', # ح
40 "\x{062E}" => 'kh', # خ
41 "\x{062F}" => 'd', # د
42 "\x{0630}" => 'dh', # ذ
43 "\x{0631}" => 'r', # ر
44 "\x{0632}" => 'z', # ز
45 "\x{0633}" => 's', # س
46 "\x{0634}" => 'sh', # ش
47 "\x{0635}" => 's', # ص
48 "\x{0636}" => 'd', # ض
49 "\x{0637}" => 't', # ط
50 "\x{0638}" => 'z', # ظ
51 "\x{0639}" => 'a', # ع
52 "\x{063A}" => 'gh', # غ
53 "\x{0641}" => 'f', # ف
54 "\x{0642}" => 'q', # ق
55 "\x{0643}" => 'k', # ك
56 "\x{0644}" => 'l', # ل
57 "\x{0645}" => 'm', # م
58 "\x{0646}" => 'n', # ن
59 "\x{0647}" => 'h', # ه
60 "\x{0648}" => 'w', # و
61 "\x{064A}" => 'y', # ي
62 },
63
64 # Arabic numbers (num2text)
65 numbers => {
66 zero => 'صفر',
67 ones => [qw(واحد اثنان ثلاثة أربعة خمسة ستة سبعة ثمانية تسعة)],
68 tens => [qw(عشرة عشرون ثلاثون أربعون خمسون ستون سبعون ثمانون تسعون)],
69 hundred => 'مائة',
70 thousand => 'ألف',
71 million => 'مليون',
72 billion => 'مليار',
73 currency => { main => 'SAR', sub => 'هللة' },
74 decimal_sep => '٫',
75 hundred_one_prefix => 0, # "مائة" not "واحد مائة"
76 thousand_one_prefix => 0, # "ألف" not "واحد ألف"
77 },
78
79 html_entities => {},
80
81 # Month and Day names (Arabic)
82 # ---------------------------------------------------------
83 months => [
84 "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو",
85 "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"
86 ],
87 days => [
88 "الأحد", "الإثنين", "الثلاثاء", "الأربعاء",
89 "الخميس", "الجمعة", "السبت"
90 ],
91
92 # ---------------------------------------------------------
93 # Formatting metadata (number, currency, date, plural)
94 # ---------------------------------------------------------
95 number_format => {
96 decimal_sep => '٫',
97 group_sep => '٬',
98 group_size => 3,
99 },
100
101 default_currency => 'SAR',
102 currency_position => 'suffix',
103 currency_space => 1,
104
105 date_format => {
106 short => 'DD/MM/YYYY',
107 medium => 'D MMM YYYY',
108 long => 'D MMMM YYYY',
109 full => 'dddd، D MMMM YYYY',
110 time => 'HH:mm',
111 datetime => 'DD/MM/YYYY HH:mm',
112 },
113
114 plural_rule => 'zero{n==0}one{n==1}two{n==2}few{n%100>=3&&n%100<=10}many{n%100>=11&&n%100<=99}other',
115 };
116 }
117
118 1;
119
120 __END__