| 1 | package AmberDB::Locale::Lang::en; | ||
| 2 | |||
| 3 | use 5.016; | ||
| 4 | use warnings; | ||
| 5 | use utf8; | ||
| 6 | |||
| 7 | our $VERSION = '5.26.6'; | ||
| 8 | my $CREATED = '2026-07-22'; | ||
| 9 | |||
| 10 | # ------------------------------------------------------- | ||
| 11 | # Pure data module — no logic, no methods other than data(). | ||
| 12 | # Returns a hash-ref consumed by AmberDB::Locale. | ||
| 13 | # | ||
| 14 | # Global Base (gb) is the default/fallback locale. | ||
| 15 | # Perl's built-in uc/lc already handle ASCII correctly, | ||
| 16 | # so most maps here are empty (no special casing needed). | ||
| 17 | # ------------------------------------------------------- | ||
| 18 | sub data { | ||
| 19 | return { | ||
| 20 | |||
| 21 | # --------------------------------------------------------- | ||
| 22 | # Casing special-cases that Perl's uc/lc does NOT handle | ||
| 23 | # correctly for this language. | ||
| 24 | # | ||
| 25 | # uc_map : applied BEFORE Perl's uc() | ||
| 26 | # key => character to replace BEFORE uc() | ||
| 27 | # value => what to replace it with | ||
| 28 | # | ||
| 29 | # lc_map : applied BEFORE Perl's lc() | ||
| 30 | # key => character to replace BEFORE lc() | ||
| 31 | # value => what to replace it with | ||
| 32 | # --------------------------------------------------------- | ||
| 33 | uc_map => {}, # English: no pre-uc substitutions needed | ||
| 34 | lc_map => {}, # English: no pre-lc substitutions needed | ||
| 35 | regex_map => {}, | ||
| 36 | phonetic_map => [ | ||
| 37 | [ 'bb' => 'b' ], | ||
| 38 | [ 'dd' => 'd' ], | ||
| 39 | [ 'ff' => 'f' ], | ||
| 40 | [ 'gg' => 'g' ], | ||
| 41 | [ 'll' => 'l' ], | ||
| 42 | [ 'mm' => 'm' ], | ||
| 43 | [ 'nn' => 'n' ], | ||
| 44 | [ 'pp' => 'p' ], | ||
| 45 | [ 'rr' => 'r' ], | ||
| 46 | [ 'ss' => 's' ], | ||
| 47 | [ 'tt' => 't' ], | ||
| 48 | [ 'zz' => 'z' ], | ||
| 49 | ], | ||
| 50 | |||
| 51 | # --------------------------------------------------------- | ||
| 52 | # Optional custom sort collation overrides. | ||
| 53 | # Unicode::Collate::Locale handles standard collation automatically. | ||
| 54 | # --------------------------------------------------------- | ||
| 55 | sort_map => {}, | ||
| 56 | |||
| 57 | |||
| 58 | # --------------------------------------------------------- | ||
| 59 | # Alphabet character class for normalize(). | ||
| 60 | # Used inside a character class: [a-zA-Z$alphabet_chars] | ||
| 61 | # Leave empty for English — only a-zA-Z is kept. | ||
| 62 | # --------------------------------------------------------- | ||
| 63 | alphabet_chars => '', | ||
| 64 | |||
| 65 | # --------------------------------------------------------- | ||
| 66 | # Accent normalization map — used by normalize(). | ||
| 67 | # Maps accented/exotic chars to their locale equivalent. | ||
| 68 | # For English: map accented chars back to plain ASCII base. | ||
| 69 | # --------------------------------------------------------- | ||
| 70 | accent_map => { | ||
| 71 | "\x{E0}" => 'a', "\x{E1}" => 'a', "\x{E2}" => 'a', "\x{E4}" => 'a', "\x{E6}" => 'ae', | ||
| 72 | "\x{E8}" => 'e', "\x{E9}" => 'e', "\x{EA}" => 'e', "\x{EB}" => 'e', | ||
| 73 | "\x{EC}" => 'i', "\x{ED}" => 'i', "\x{EE}" => 'i', "\x{EF}" => 'i', | ||
| 74 | "\x{F2}" => 'o', "\x{F3}" => 'o', "\x{F4}" => 'o', "\x{F6}" => 'o', | ||
| 75 | "\x{F9}" => 'u', "\x{FA}" => 'u', "\x{FB}" => 'u', "\x{FC}" => 'u', | ||
| 76 | "\x{F1}" => 'n', "\x{E7}" => 'c', "\x{DF}" => 'ss', | ||
| 77 | "\x{C0}" => 'A', "\x{C1}" => 'A', "\x{C2}" => 'A', "\x{C4}" => 'A', "\x{C6}" => 'AE', | ||
| 78 | "\x{C8}" => 'E', "\x{C9}" => 'E', "\x{CA}" => 'E', "\x{CB}" => 'E', | ||
| 79 | "\x{CC}" => 'I', "\x{CD}" => 'I', "\x{CE}" => 'I', "\x{CF}" => 'I', | ||
| 80 | "\x{D2}" => 'O', "\x{D3}" => 'O', "\x{D4}" => 'O', "\x{D6}" => 'O', | ||
| 81 | "\x{D9}" => 'U', "\x{DA}" => 'U', "\x{DB}" => 'U', "\x{DC}" => 'U', | ||
| 82 | "\x{D1}" => 'N', "\x{C7}" => 'C', | ||
| 83 | }, | ||
| 84 | |||
| 85 | # --------------------------------------------------------- | ||
| 86 | # ASCII transliteration pre-map — used BEFORE NFD in to_ascii(). | ||
| 87 | # | ||
| 88 | # For English, NFD + \p{M} strip handles ALL accented chars | ||
| 89 | # automatically (à→a, é→e, ü→u, ç→c, etc.). | ||
| 90 | # | ||
| 91 | # Only exceptions that NFD cannot decompose: | ||
| 92 | # ß (U+00DF) — no NFD decomposition → ss | ||
| 93 | # æ (U+00E6) — no NFD decomposition → ae (ligature) | ||
| 94 | # Æ (U+00C6) — no NFD decomposition → AE | ||
| 95 | # œ (U+0153) — no NFD decomposition → oe (ligature) | ||
| 96 | # Œ (U+0152) — no NFD decomposition → OE | ||
| 97 | # --------------------------------------------------------- | ||
| 98 | ascii_map => { | ||
| 99 | "\x{DF}" => 'ss', # ß → ss | ||
| 100 | "\x{E6}" => 'ae', "\x{C6}" => 'AE', # æ → ae, Æ → AE | ||
| 101 | "\x{153}" => 'oe', "\x{152}" => 'OE', # œ → oe, Œ → OE | ||
| 102 | }, | ||
| 103 | |||
| 104 | |||
| 105 | # --------------------------------------------------------- | ||
| 106 | # num2text number words | ||
| 107 | # --------------------------------------------------------- | ||
| 108 | numbers => { | ||
| 109 | zero => 'Zero', | ||
| 110 | ones => [qw(One Two Three Four Five Six Seven Eight Nine)], | ||
| 111 | tens => [qw(Ten Twenty Thirty Forty Fifty Sixty Seventy Eighty Ninety)], | ||
| 112 | hundred => 'Hundred', | ||
| 113 | thousand => 'Thousand', | ||
| 114 | million => 'Million', | ||
| 115 | billion => 'Billion', | ||
| 116 | currency => { main => 'USD', sub => 'cent' }, | ||
| 117 | decimal_sep => '.', | ||
| 118 | hundred_one_prefix => 1, # One Hundred | ||
| 119 | thousand_one_prefix => 1, # One Thousand | ||
| 120 | }, | ||
| 121 | |||
| 122 | # --------------------------------------------------------- | ||
| 123 | # Locale-specific HTML entity extras. | ||
| 124 | # Universal entities (& < > etc.) are handled | ||
| 125 | # inside Language.pm and do NOT need to be listed here. | ||
| 126 | # Only add language-specific named entities. | ||
| 127 | # --------------------------------------------------------- | ||
| 128 | html_entities => {}, # English has no extra named entities | ||
| 129 | |||
| 130 | # --------------------------------------------------------- | ||
| 131 | # Month and Day names | ||
| 132 | # --------------------------------------------------------- | ||
| 133 | months => [ | ||
| 134 | "January", "February", "March", "April", "May", "June", | ||
| 135 | "July", "August", "September", "October", "November", "December" | ||
| 136 | ], | ||
| 137 | days => [ | ||
| 138 | "Sunday", "Monday", "Tuesday", "Wednesday", | ||
| 139 | "Thursday", "Friday", "Saturday" | ||
| 140 | ], | ||
| 141 | |||
| 142 | # --------------------------------------------------------- | ||
| 143 | # Formatting metadata (number, currency, date, plural) | ||
| 144 | # --------------------------------------------------------- | ||
| 145 | number_format => { | ||
| 146 | decimal_sep => '.', | ||
| 147 | group_sep => ',', | ||
| 148 | group_size => 3, | ||
| 149 | }, | ||
| 150 | |||
| 151 | default_currency => 'USD', | ||
| 152 | currency_position => 'prefix', | ||
| 153 | currency_space => 0, | ||
| 154 | |||
| 155 | date_format => { | ||
| 156 | short => 'MM/DD/YYYY', | ||
| 157 | medium => 'MMM D, YYYY', | ||
| 158 | long => 'MMMM D, YYYY', | ||
| 159 | full => 'dddd, MMMM D, YYYY', | ||
| 160 | time => 'HH:mm', | ||
| 161 | datetime => 'MM/DD/YYYY HH:mm', | ||
| 162 | }, | ||
| 163 | |||
| 164 | plural_rule => 'one{n==1}other', | ||
| 165 | }; | ||
| 166 | } | ||
| 167 | |||
| 168 | 1; | ||
| 169 | |||
| 170 | __END__ |