Inflector.php
public static function transliterate($text, $direction = "en") {
        if ($direction == "en") {
            $text = str_replace(self::$_cyrillicTranslit, self::$_latinTranslit, $text);
        } else {
            $text = str_replace(self::$_latinTranslit, self::$_cyrillicTranslit, $text);
        }

        $text = preg_replace("#([qwrtpsdfghklzxcvbnmQWRTPSDFGHKLZXCVBNM]+)[jJ]e#", "\${1}e", $text);
        $text = preg_replace("#([qwrtpsdfghklzxcvbnmQWRTPSDFGHKLZXCVBNM]+)[jJ]#", "\${1}'", $text);
        $text = preg_replace("#([ eyuioaEYUIOA-]+)[Kk]h#", "\${1}h", $text);
        $text = preg_replace("#^kh#", "h", $text);
        $text = preg_replace("#^Kh#", "H", $text);

        return $text;
    }
public static function transliterate($text, $direction = "en") {
        if ($direction == "en") {
            $text = str_replace(self::$_cyrillicTranslit, self::$_latinTranslit, $text);
        } else {
            $text = str_replace(self::$_latinTranslit, self::$_cyrillicTranslit, $text);
        }

        $text = preg_replace("#([qwrtpsdfghklzxcvbnmQWRTPSDFGHKLZXCVBNM]+)[jJ]e#", "\${1}e", $text);
        $text = preg_replace("#([qwrtpsdfghklzxcvbnmQWRTPSDFGHKLZXCVBNM]+)[jJ]#", "\${1}'", $text);
        $text = preg_replace("#([ eyuioaEYUIOA-]+)[Kk]h#", "\${1}h", $text);
        $text = preg_replace("#^kh#", "h", $text);
        $text = preg_replace("#^Kh#", "H", $text);

        return $text;
    }
public static function transliterate ( $ text , $ direction = "en" ) { if ( $ direction == "en" ) { $ text = str_replace ( self :: $ _cyrillicTranslit , self :: $ _latinTranslit , $ text ) ; } else { $ text = str_replace ( self :: $ _latinTranslit , self :: $ _cyrillicTranslit , $ text ) ; } $ text = preg_replace ( "#([qwrtpsdfghklzxcvbnmQWRTPSDFGHKLZXCVBNM]+)[jJ]e#" , "\${1}e" , $ text ) ; $ text = preg_replace ( "#([qwrtpsdfghklzxcvbnmQWRTPSDFGHKLZXCVBNM]+)[jJ]#" , "\${1}'" , $ text ) ; $ text = preg_replace ( "#([ eyuioaEYUIOA-]+)[Kk]h#" , "\${1}h" , $ text ) ; $ text = preg_replace ( "#^kh#" , "h" , $ text ) ; $ text = preg_replace ( "#^Kh#" , "H" , $ text ) ; return $ text ; }
Do text transliteration

@static
@param string $text Text to transliteration
@param string $direction "en" or "ru"
@return string transliterated text
Do text transliteration