| 1 | package AmberDB::Locale::Lang::tr; | ||
| 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 | # Turkish locale data for AmberDB::Locale. | ||
| 12 | # Pure data module — no logic. | ||
| 13 | # | ||
| 14 | # Turkish-specific casing rules (dotted/dotless-I): | ||
| 15 | # Lowercase: I → ı (U+0131) dotless i | ||
| 16 | # İ → i dotted I to i | ||
| 17 | # Uppercase: i → İ (U+0130) dotted I | ||
| 18 | # (ı → I handled by Perl's uc() already) | ||
| 19 | # ------------------------------------------------------- | ||
| 20 | sub data { | ||
| 21 | return { | ||
| 22 | |||
| 23 | # --------------------------------------------------------- | ||
| 24 | # Casing special-cases (see Language.pm for usage) | ||
| 25 | # uc_map: replacements applied BEFORE Perl's uc() | ||
| 26 | # lc_map: replacements applied BEFORE Perl's lc() | ||
| 27 | # --------------------------------------------------------- | ||
| 28 | uc_map => { | ||
| 29 | 'i' => "\x{130}", # Latin i → Turkish dotted İ (before uc) | ||
| 30 | }, | ||
| 31 | lc_map => { | ||
| 32 | 'I' => "\x{131}", # Latin I → Turkish dotless ı | ||
| 33 | "\x{130}" => 'i', # Turkish dotted İ → i | ||
| 34 | }, | ||
| 35 | |||
| 36 | # --------------------------------------------------------- | ||
| 37 | # Case-insensitive search regex character map | ||
| 38 | # --------------------------------------------------------- | ||
| 39 | regex_map => { | ||
| 40 | 'ç' => '[çÇ]', | ||
| 41 | 'Ç' => '[çÇ]', | ||
| 42 | 'ğ' => '[ğĞ]', | ||
| 43 | 'Ğ' => '[ğĞ]', | ||
| 44 | 'ı' => '[ıI]', | ||
| 45 | 'I' => '[ıI]', | ||
| 46 | 'i' => '[iİ]', | ||
| 47 | "\x{130}" => '[iİ]', | ||
| 48 | 'ö' => '[öÖ]', | ||
| 49 | 'Ö' => '[öÖ]', | ||
| 50 | 'ü' => '[üÜ]', | ||
| 51 | 'Ü' => '[üÜ]', | ||
| 52 | 'ş' => '[şŞ]', | ||
| 53 | 'Ş' => '[şŞ]', | ||
| 54 | }, | ||
| 55 | |||
| 56 | # Phonetic assimilation and final-devoicing rules | ||
| 57 | phonetic_map => [ | ||
| 58 | [ 'b$' => 'p' ], | ||
| 59 | [ 'd$' => 't' ], | ||
| 60 | [ 'g$' => 'k' ], | ||
| 61 | ], | ||
| 62 | |||
| 63 | # --------------------------------------------------------- | ||
| 64 | # Optional custom sort collation overrides. | ||
| 65 | # Unicode::Collate::Locale handles standard collation automatically. | ||
| 66 | # --------------------------------------------------------- | ||
| 67 | sort_map => {}, | ||
| 68 | |||
| 69 | |||
| 70 | # --------------------------------------------------------- | ||
| 71 | # Alphabet character class for normalize(). | ||
| 72 | # Characters that are considered valid letters in Turkish text. | ||
| 73 | # Used inside a regex character class alongside a-zA-Z. | ||
| 74 | # --------------------------------------------------------- | ||
| 75 | alphabet_chars => "\x{E7}\x{C7}\x{11F}\x{11E}\x{131}I\x{130}\x{F6}\x{D6}\x{15F}\x{15E}\x{FC}\x{DC}", | ||
| 76 | # ç Ç ğ Ğ ı I İ ö Ö ş Ş ü Ü | ||
| 77 | |||
| 78 | # --------------------------------------------------------- | ||
| 79 | # Accent normalization map — used by normalize(). | ||
| 80 | # Maps accented characters to the closest Turkish equivalent. | ||
| 81 | # Note: î → i (not İ) since we are in text normalization, | ||
| 82 | # ô → ö (Turkish convention), etc. | ||
| 83 | # --------------------------------------------------------- | ||
| 84 | accent_map => { | ||
| 85 | "\x{E2}" => 'a', "\x{C2}" => 'A', # â → a, Â → A | ||
| 86 | "\x{E0}" => 'a', "\x{C0}" => 'A', # à → a, À → A | ||
| 87 | "\x{E1}" => 'a', "\x{C1}" => 'A', # á → a, Á → A | ||
| 88 | "\x{EA}" => 'e', "\x{CA}" => 'E', # ê → e, Ê → E | ||
| 89 | "\x{E8}" => 'e', "\x{C8}" => 'E', # è → e, È → E | ||
| 90 | "\x{E9}" => 'e', "\x{C9}" => 'E', # é → e, É → E | ||
| 91 | "\x{EE}" => 'i', "\x{CE}" => "\x{130}", # î → i, Î → İ (Türkçe) | ||
| 92 | "\x{EC}" => 'i', "\x{CC}" => "\x{130}", # ì → i, Ì → İ | ||
| 93 | "\x{ED}" => 'i', "\x{CD}" => "\x{130}", # í → i, Í → İ | ||
| 94 | "\x{F4}" => "\x{F6}", "\x{D4}" => "\x{D6}", # ô → ö, Ô → Ö (Türkçe) | ||
| 95 | "\x{F2}" => 'o', "\x{D2}" => 'O', # ò → o, Ò → O | ||
| 96 | "\x{F3}" => 'o', "\x{D3}" => 'O', # ó → o, Ó → O | ||
| 97 | "\x{FB}" => 'u', "\x{DB}" => 'U', # û → u, Û → U | ||
| 98 | "\x{F9}" => 'u', "\x{D9}" => 'U', # ù → u, Ù → U | ||
| 99 | "\x{FA}" => 'u', "\x{DA}" => 'U', # ú → u, Ú → U | ||
| 100 | }, | ||
| 101 | |||
| 102 | # --------------------------------------------------------- | ||
| 103 | # ASCII transliteration pre-map — used BEFORE NFD in to_ascii(). | ||
| 104 | # | ||
| 105 | # Only list chars that Unicode NFD cannot decompose automatically, | ||
| 106 | # or chars that need language-specific transliteration different | ||
| 107 | # from what NFD would produce. | ||
| 108 | # | ||
| 109 | # NFD handles automatically (no entry needed here): | ||
| 110 | # ç→c ğ→g ş→s ö→o ü→u İ→I | ||
| 111 | # â→a î→i û→u (and all other accented vowels) | ||
| 112 | # | ||
| 113 | # Exceptions for Turkish: | ||
| 114 | # ı (U+0131, dotless-i) — has no NFD decomposition → must map manually | ||
| 115 | # --------------------------------------------------------- | ||
| 116 | ascii_map => { | ||
| 117 | "\x{131}" => 'i', # ı (U+0131, dotless-i) — no NFD decomposition | ||
| 118 | }, | ||
| 119 | |||
| 120 | |||
| 121 | # --------------------------------------------------------- | ||
| 122 | # num2text number words (Turkish) | ||
| 123 | # ones[0] = "Bir" (for 1), ones[8] = "Dokuz" (for 9) | ||
| 124 | # --------------------------------------------------------- | ||
| 125 | numbers => { | ||
| 126 | zero => 'Sıfır', | ||
| 127 | negative => 'Eksi', | ||
| 128 | ones => [qw(Bir İki Üç Dört Beş Altı Yedi Sekiz Dokuz)], | ||
| 129 | tens => [qw(On Yirmi Otuz Kırk Elli Altmış Yetmiş Seksen Doksan)], | ||
| 130 | hundred => 'Yüz', | ||
| 131 | thousand => 'Bin', | ||
| 132 | million => 'Milyon', | ||
| 133 | billion => 'Milyar', | ||
| 134 | currency => { main => 'TL', sub => 'KR' }, | ||
| 135 | decimal_sep => ',', | ||
| 136 | # Special rules: "Yüz" not "Bir Yüz", "Bin" not "Bir Bin" | ||
| 137 | hundred_one_prefix => 0, | ||
| 138 | thousand_one_prefix => 0, | ||
| 139 | }, | ||
| 140 | |||
| 141 | # --------------------------------------------------------- | ||
| 142 | # Locale-specific HTML entity extras | ||
| 143 | # --------------------------------------------------------- | ||
| 144 | html_entities => { | ||
| 145 | 'ç' => "\x{E7}", 'Ç' => "\x{C7}", # ç, Ç | ||
| 146 | 'ş' => "\x{15F}", 'Ş' => "\x{15E}", # ş, Ş | ||
| 147 | 'ğ' => "\x{11F}", 'Ğ' => "\x{11E}", # ğ, Ğ | ||
| 148 | 'â' => "\x{E2}", 'Â' => "\x{C2}", # â, Â | ||
| 149 | 'î' => "\x{EE}", 'Î' => "\x{CE}", # î, Î | ||
| 150 | 'û' => "\x{FB}", 'Û' => "\x{DB}", # û, Û | ||
| 151 | 'ü' => "\x{FC}", 'Ü' => "\x{DC}", # ü, Ü | ||
| 152 | 'ö' => "\x{F6}", 'Ö' => "\x{D6}", # ö, Ö | ||
| 153 | }, | ||
| 154 | |||
| 155 | # --------------------------------------------------------- | ||
| 156 | # Month and Day names (Turkish) | ||
| 157 | # --------------------------------------------------------- | ||
| 158 | months => [ | ||
| 159 | "Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", | ||
| 160 | "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık" | ||
| 161 | ], | ||
| 162 | days => [ | ||
| 163 | "Pazar", "Pazartesi", "Salı", "Çarşamba", | ||
| 164 | "Perşembe", "Cuma", "Cumartesi" | ||
| 165 | ], | ||
| 166 | |||
| 167 | # --------------------------------------------------------- | ||
| 168 | # Formatting metadata (number, currency, date, plural) | ||
| 169 | # --------------------------------------------------------- | ||
| 170 | number_format => { | ||
| 171 | decimal_sep => ',', | ||
| 172 | group_sep => '.', | ||
| 173 | group_size => 3, | ||
| 174 | }, | ||
| 175 | |||
| 176 | default_currency => 'TRY', | ||
| 177 | currency_position => 'prefix', | ||
| 178 | currency_space => 0, | ||
| 179 | |||
| 180 | date_format => { | ||
| 181 | short => 'DD.MM.YYYY', | ||
| 182 | medium => 'D MMM YYYY', | ||
| 183 | long => 'D MMMM YYYY', | ||
| 184 | full => 'dddd, D MMMM YYYY', | ||
| 185 | time => 'HH:mm', | ||
| 186 | datetime => 'DD.MM.YYYY HH:mm', | ||
| 187 | }, | ||
| 188 | |||
| 189 | plural_rule => 'one{n==1}other', | ||
| 190 | }; | ||
| 191 | } | ||
| 192 | |||
| 193 | 1; | ||
| 194 | |||
| 195 | __END__ |