mirror of
https://github.com/fzaninotto/Faker.git
synced 2025-03-23 16:59:53 +01:00
Added missed file Utils.php
This commit is contained in:
parent
b0b6eb6029
commit
fac7a27e35
58
src/Faker/Provider/ua_UA/Utils.php
Normal file
58
src/Faker/Provider/ua_UA/Utils.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace Faker\Provider\ua_UA;
|
||||
|
||||
/**
|
||||
* Some utils what ua_UA provider needs
|
||||
*/
|
||||
Class Utils
|
||||
{
|
||||
/**
|
||||
* Translate cyrillic text to latin
|
||||
* Useful for URL ang email generation
|
||||
* @param string $string
|
||||
* @return string
|
||||
*/
|
||||
public static function cyrillicToLatin($string = '') {
|
||||
$replace=array(
|
||||
"'"=>"",
|
||||
"`"=>"",
|
||||
"а"=>"a","А"=>"a",
|
||||
"б"=>"b","Б"=>"b",
|
||||
"в"=>"v","В"=>"v",
|
||||
"г"=>"g","Г"=>"g",
|
||||
"д"=>"d","Д"=>"d",
|
||||
"е"=>"e","Е"=>"e",
|
||||
"ж"=>"zh","Ж"=>"zh",
|
||||
"з"=>"z","З"=>"z",
|
||||
"и"=>"i","И"=>"i",
|
||||
"й"=>"y","Й"=>"y",
|
||||
"к"=>"k","К"=>"k",
|
||||
"л"=>"l","Л"=>"l",
|
||||
"м"=>"m","М"=>"m",
|
||||
"н"=>"n","Н"=>"n",
|
||||
"о"=>"o","О"=>"o",
|
||||
"п"=>"p","П"=>"p",
|
||||
"р"=>"r","Р"=>"r",
|
||||
"с"=>"s","С"=>"s",
|
||||
"т"=>"t","Т"=>"t",
|
||||
"у"=>"u","У"=>"u",
|
||||
"ф"=>"f","Ф"=>"f",
|
||||
"х"=>"h","Х"=>"h",
|
||||
"ц"=>"c","Ц"=>"c",
|
||||
"ч"=>"ch","Ч"=>"ch",
|
||||
"ш"=>"sh","Ш"=>"sh",
|
||||
"щ"=>"sch","Щ"=>"sch",
|
||||
"ъ"=>"","Ъ"=>"",
|
||||
"ы"=>"y","Ы"=>"y",
|
||||
"ь"=>"","Ь"=>"",
|
||||
"э"=>"e","Э"=>"e",
|
||||
"ю"=>"yu","Ю"=>"yu",
|
||||
"я"=>"ya","Я"=>"ya",
|
||||
"і"=>"i","І"=>"i",
|
||||
"ї"=>"yi","Ї"=>"yi",
|
||||
"є"=>"e","Є"=>"e"
|
||||
);
|
||||
return strtr($string, $replace);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user