Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
stepanenko3 committed Mar 14, 2024
1 parent d82e9a1 commit a045498
Showing 1 changed file with 58 additions and 11 deletions.
69 changes: 58 additions & 11 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,64 @@ function carbon(DateTimeInterface | string | null $parseString = '', ?string $tz
function translit_to_ua(string $text): string
{
$alphabet = [
'a' => 'а', 'b' => 'б', 'v' => 'в', 'g' => 'г', 'd' => 'д', 'e' => 'е', 'yo' => 'ё',
'j' => 'ж', 'z' => 'з', 'i' => 'и', 'i' => 'й', 'k' => 'к', 'l' => 'л', 'm' => 'м',
'n' => 'н', 'o' => 'о', 'p' => 'п', 'r' => 'р', 's' => 'с', 't' => 'т', 'y' => 'у',
'f' => 'ф', 'h' => 'х', 'c' => 'ц', 'ch' => 'ч', 'sh' => 'ш', 'sh' => 'щ', 'i' => 'ы',
'e' => 'е', 'u' => 'у', 'ya' => 'я', 'A' => 'А', 'B' => 'Б', 'V' => 'В', 'G' => 'Г',
'D' => 'Д', 'E' => 'Е', 'Yo' => 'Ё', 'J' => 'Ж', 'Z' => 'З', 'I' => 'И', 'I' => 'Й',
'K' => 'К', 'L' => 'Л', 'M' => 'М', 'N' => 'Н', 'O' => 'О', 'P' => 'П', 'R' => 'Р',
'S' => 'С', 'T' => 'Т', 'Y' => 'Ю', 'F' => 'Ф', 'H' => 'Х', 'C' => 'Ц', 'Ch' => 'Ч',
'Sh' => 'Ш', 'Sh' => 'Щ', 'I' => 'Ы', 'E' => 'Е', 'U' => 'У', 'Ya' => 'Я', '\'' => 'ь',
'\'' => 'Ь', '\'\'' => 'ъ', '\'\'' => 'Ъ', 'j' => 'ї', 'i' => 'и', 'g' => 'ґ',
'ye' => 'є', 'J' => 'Ї', 'I' => 'І', 'G' => 'Ґ', 'YE' => 'Є',
'a' => 'а',
'b' => 'б',
'v' => 'в',
'g' => 'г',
'd' => 'д',
'e' => 'е',
'yo' => 'ё',
'j' => 'ж',
'z' => 'з',
'i' => 'и',
'k' => 'к',
'l' => 'л',
'm' => 'м',
'n' => 'н',
'o' => 'о',
'p' => 'п',
'r' => 'р',
's' => 'с',
't' => 'т',
'y' => 'у',
'f' => 'ф',
'h' => 'х',
'c' => 'ц',
'ch' => 'ч',
'sh' => 'ш',
'u' => 'у',
'ya' => 'я',
'A' => 'А',
'B' => 'Б',
'V' => 'В',
'G' => 'Г',
'D' => 'Д',
'E' => 'Е',
'Yo' => 'Ё',
'J' => 'Ж',
'Z' => 'З',
'I' => 'И',
'K' => 'К',
'L' => 'Л',
'M' => 'М',
'N' => 'Н',
'O' => 'О',
'P' => 'П',
'R' => 'Р',
'S' => 'С',
'T' => 'Т',
'Y' => 'Ю',
'F' => 'Ф',
'H' => 'Х',
'C' => 'Ц',
'Ch' => 'Ч',
'Sh' => 'Ш',
'U' => 'У',
'Ya' => 'Я',
'\'' => 'ь',
'\'\'' => 'ъ',
'ye' => 'є',
'YE' => 'Є',
];

return str_ireplace(
Expand Down

0 comments on commit a045498

Please sign in to comment.