ostapdontstop

rustolat

Jan 20th, 2020
191
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $gost = array(
  2.    "Є"=>"EH","І"=>"I","і"=>"i","№"=>"#","є"=>"eh",
  3.    "А"=>"A","Б"=>"B","В"=>"V","Г"=>"G","Д"=>"D",
  4.    "Е"=>"E","Ё"=>"JO","Ж"=>"ZH",
  5.    "З"=>"Z","И"=>"I","Й"=>"JJ","К"=>"K","Л"=>"L",
  6.    "М"=>"M","Н"=>"N","О"=>"O","П"=>"P","Р"=>"R",
  7.    "С"=>"S","Т"=>"T","У"=>"U","Ф"=>"F","Х"=>"KH",
  8.    "Ц"=>"C","Ч"=>"CH","Ш"=>"SH","Щ"=>"SHH","Ъ"=>"'",
  9.    "Ы"=>"Y","Ь"=>"","Э"=>"EH","Ю"=>"YU","Я"=>"YA",
  10.    "а"=>"a","б"=>"b","в"=>"v","г"=>"g","д"=>"d",
  11.    "е"=>"e","ё"=>"jo","ж"=>"zh",
  12.    "з"=>"z","и"=>"i","й"=>"jj","к"=>"k","л"=>"l",
  13.    "м"=>"m","н"=>"n","о"=>"o","п"=>"p","р"=>"r",
  14.    "с"=>"s","т"=>"t","у"=>"u","ф"=>"f","х"=>"kh",
  15.    "ц"=>"c","ч"=>"ch","ш"=>"sh","щ"=>"shh","ъ"=>"",
  16.    "ы"=>"y","ь"=>"","э"=>"eh","ю"=>"yu","я"=>"ya",
  17.    "—"=>"-","«"=>"","»"=>"","…"=>""
  18.   );
  19.  
  20. $iso = array(
  21.    "Є"=>"YE","І"=>"I","Ѓ"=>"G","і"=>"i","№"=>"#","є"=>"ye","ѓ"=>"g",
  22.    "А"=>"A","Б"=>"B","В"=>"V","Г"=>"G","Д"=>"D",
  23.    "Е"=>"E","Ё"=>"YO","Ж"=>"ZH",
  24.    "З"=>"Z","И"=>"I","Й"=>"J","К"=>"K","Л"=>"L",
  25.    "М"=>"M","Н"=>"N","О"=>"O","П"=>"P","Р"=>"R",
  26.    "С"=>"S","Т"=>"T","У"=>"U","Ф"=>"F","Х"=>"X",
  27.    "Ц"=>"C","Ч"=>"CH","Ш"=>"SH","Щ"=>"SHH","Ъ"=>"'",
  28.    "Ы"=>"Y","Ь"=>"","Э"=>"E","Ю"=>"YU","Я"=>"YA",
  29.    "а"=>"a","б"=>"b","в"=>"v","г"=>"g","д"=>"d",
  30.    "е"=>"e","ё"=>"yo","ж"=>"zh",
  31.    "з"=>"z","и"=>"i","й"=>"j","к"=>"k","л"=>"l",
  32.    "м"=>"m","н"=>"n","о"=>"o","п"=>"p","р"=>"r",
  33.    "с"=>"s","т"=>"t","у"=>"u","ф"=>"f","х"=>"x",
  34.    "ц"=>"c","ч"=>"ch","ш"=>"sh","щ"=>"shh","ъ"=>"",
  35.    "ы"=>"y","ь"=>"","э"=>"e","ю"=>"yu","я"=>"ya",
  36.    "—"=>"-","«"=>"","»"=>"","…"=>""
  37.   );
  38.  
  39. function sanitize_title_with_translit($title) {
  40.     global $gost, $iso;
  41.     $rtl_standard = get_option('rtl_standard');
  42.     switch ($rtl_standard) {
  43.         case 'off':
  44.             return $title;     
  45.         case 'gost':
  46.             return strtr($title, $gost);
  47.         default:
  48.             return strtr($title, $iso);
  49.     }
  50. }
RAW Paste Data