GetSimple Support Forum
Field: Slug/URL - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: Field: Slug/URL (/showthread.php?tid=1151)



Field: Slug/URL - irkuser - 2010-11-28

When I am filling field Header of page in Russan letters, this page will saving without id.
What may I do? To write a function for translate Russan letters to English letters?
Somebody had this problem?


Field: Slug/URL - irkuser - 2010-11-29

I write a function on admin/inc/basic.php

Code:
function rus_to_lat($text) {
  
$gost = array(
   "Є"=>"EH","І"=>"I","і"=>"i","№"=>"#","є"=>"eh",
   "А"=>"A","Б"=>"B","В"=>"V","Г"=>"G","Д"=>"D",
   "Е"=>"E","Ё"=>"JO","Ж"=>"ZH",
   "З"=>"Z","И"=>"I","Й"=>"JJ","К"=>"K","Л"=>"L",
   "М"=>"M","Н"=>"N","О"=>"O","П"=>"P","Р"=>"R",
   "С"=>"S","Т"=>"T","У"=>"U","Ф"=>"F","Ð¥"=>"KH",
   "Ц"=>"C","Ч"=>"CH","Ш"=>"SH","Щ"=>"SHH","Ъ"=>"'",
   "Ы"=>"Y","Ь"=>"","Э"=>"EH","Ю"=>"YU","Я"=>"YA",
   "а"=>"a","б"=>"b","в"=>"v","г"=>"g","д"=>"d",
   "е"=>"e","ё"=>"jo","ж"=>"zh",
   "з"=>"z","и"=>"i","й"=>"jj","к"=>"k","л"=>"l",
   "м"=>"m","н"=>"n","о"=>"o","п"=>"p","р"=>"r",
   "с"=>"s","т"=>"t","у"=>"u","ф"=>"f","х"=>"kh",
   "ц"=>"c","ч"=>"ch","ш"=>"sh","щ"=>"shh","ъ"=>"",
   "ы"=>"y","ь"=>"","э"=>"eh","ю"=>"yu","я"=>"ya","«"=>"","»"=>"","—"=>"-"
  );

$iso = array(
   "Є"=>"YE","І"=>"I","Ѓ"=>"G","і"=>"i","№"=>"#","є"=>"ye","ѓ"=>"g",
   "А"=>"A","Б"=>"B","В"=>"V","Г"=>"G","Д"=>"D",
   "Е"=>"E","Ё"=>"YO","Ж"=>"ZH",
   "З"=>"Z","И"=>"I","Й"=>"J","К"=>"K","Л"=>"L",
   "М"=>"M","Н"=>"N","О"=>"O","П"=>"P","Р"=>"R",
   "С"=>"S","Т"=>"T","У"=>"U","Ф"=>"F","Ð¥"=>"X",
   "Ц"=>"C","Ч"=>"CH","Ш"=>"SH","Щ"=>"SHH","Ъ"=>"'",
   "Ы"=>"Y","Ь"=>"","Э"=>"E","Ю"=>"YU","Я"=>"YA",
   "а"=>"a","б"=>"b","в"=>"v","г"=>"g","д"=>"d",
   "е"=>"e","ё"=>"yo","ж"=>"zh",
   "з"=>"z","и"=>"i","й"=>"j","к"=>"k","л"=>"l",
   "м"=>"m","н"=>"n","о"=>"o","п"=>"p","р"=>"r",
   "с"=>"s","т"=>"t","у"=>"u","ф"=>"f","х"=>"x",
   "ц"=>"c","ч"=>"ch","ш"=>"sh","щ"=>"shh","ъ"=>"",
   "ы"=>"y","ь"=>"","э"=>"e","ю"=>"yu","я"=>"ya","«"=>"","»"=>"","—"=>"-"
  );

    $rtl_standard = 1; // 1 = gost; 2 = iso
    if ($rtl_standard = 1) {
        return strtr($text, $gost);
    } else if ($rtl_standard = 2) {
        return strtr($text, $iso);
    }
}


I change on admin/changedata.php

Code:
//$url = to7bit($url, "UTF-8");
$url = rus_to_lat($url);


My problem was done!

Maybe do you know any way?

P.S. This idea from plugin rus-to-lat for Wordpress.


Field: Slug/URL - yojoe - 2010-11-29

Of course we know.
Martin created a plugin for such problems Smile
Here's the thread: http://get-simple.info/forum/topic/1088/getsimple-203-plus-unofficial-build-for-our-russian-friends/
plugin can be found in extensions; it works like a charm for all special characters you define Smile


Field: Slug/URL - irkuser - 2010-11-29

yojoe Wrote:Of course we know.
Martin created a plugin for such problems Smile
Here's the thread: http://get-simple.info/forum/topic/1088/getsimple-203-plus-unofficial-build-for-our-russian-friends/
plugin can be found in extensions; it works like a charm for all special characters you define Smile

Thank you!