This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

Ivanko

  • *****
  • 388 posts
ERORR in formating PHP for cyrilic
« on: June 13, 2021, 06:05:23 PM »
There is an error in formatting.php

Please use below code
Code: [Select]
//ru_RU translit
        if (is_utf8($string)) {
            $chars = array(
                "А"=>"a","Б"=>"b","В"=>"v","Г"=>"g",
                "Д"=>"d","Е"=>"e","Ж"=>"z","З"=>"z","И"=>"i",
                "Й"=>"j","К"=>"k","Л"=>"l","М"=>"m","Н"=>"n",
                "О"=>"o","П"=>"p","Р"=>"r","С"=>"s","Т"=>"t",
                "У"=>"u","Ф"=>"f","Х"=>"h","Ц"=>"c","Ч"=>"ch",
                "Ш"=>"sh","Щ"=>"w","Ъ"=>"","Ы"=>"i","Ь"=>"",
                "Э"=>"e","Ю"=>"ju","Я"=>"ja","а"=>"a","б"=>"b",
                "в"=>"v","г"=>"g","д"=>"d","е"=>"e", "ё"=>"e","ж"=>"z",
                "з"=>"z","и"=>"i","й"=>"j","к"=>"k","л"=>"l",
                "м"=>"m","н"=>"n","о"=>"o","п"=>"p","р"=>"r",
                "с"=>"s","т"=>"t","у"=>"u","ф"=>"f","х"=>"h",
                "ц"=>"c","ч"=>"ch","ш"=>"sh","щ"=>"w","ъ"=>"y",
                "ы"=>"i","ь"=>"","э"=>"e","ю"=>"ju","я"=>"ja",
                " "=> "-", "."=> "", "/"=> "-", "-" => "-");
            $string = strtr($string, $chars);
        }
        //ru_RU translit

or at least correct chars

your letters are wrong
Code: [Select]
    $cyr = array('а','б','в','г','д','ѓ','е','ж','з','ѕ','и','ј','к','л','љ','м','н','њ','о','п','р','с','т','ќ','у','ф','х','ц','ч','џ','ш','А','Б','В','Г','Д','Ѓ','Е','Ж','З','Ѕ','И','Ј','К','Л','Љ','М','Н','Њ','О','П','Р','С','Т','Ќ','У','Ф','Х','Ц','Ч','Џ','Ш','€');
    $lat = array('a','b','v','g','d','gj','e','zh','z','dz','i','j','k','l','lj','m','n','nj','o','p','r','s','t','kj','u','f','h','c','ch','dz','sh','A','B','V','G','D','GJ','E','ZH','Z','DZ','I','J','K','L' ,'LJ' ,'M' ,'N' ,'NJ' ,'O' ,'P', 'R', 'S', 'T','KJ','U','F','H','C','CH','DZ','SH','EUR');
    $string = str_replace($cyr, $lat, $string);

what chars are below ) ?
ѓ , љ , њ, € ... etc )))
« Last Edit: June 13, 2021, 06:07:11 PM by Ivanko »

*

MB Themes

Re: ERORR in formating PHP for cyrilic
« Reply #1 on: June 14, 2021, 09:06:43 AM »
@Ivanko
what chars are below ) ?
ѓ , љ , њ, € ... etc

Checking code you've posted and they are not mentioned here.
Code: [Select]
$chars = array( "А"=>"a","Б"=>"b","В"=>"v","Г"=>"g", "Д"=>"d","Е"=>"e","Ж"=>"z","З"=>"z","И"=>"i", "Й"=>"j","К"=>"k","Л"=>"l","М"=>"m","Н"=>"n", "О"=>"o","П"=>"p","Р"=>"r","С"=>"s","Т"=>"t", "У"=>"u","Ф"=>"f","Х"=>"h","Ц"=>"c","Ч"=>"ch", "Ш"=>"sh","Щ"=>"w","Ъ"=>"","Ы"=>"i","Ь"=>"", "Э"=>"e","Ю"=>"ju","Я"=>"ja","а"=>"a","б"=>"b", "в"=>"v","г"=>"g","д"=>"d","е"=>"e", "ё"=>"e","ж"=>"z", "з"=>"z","и"=>"i","й"=>"j","к"=>"k","л"=>"l", "м"=>"m","н"=>"n","о"=>"o","п"=>"p","р"=>"r", "с"=>"s","т"=>"t","у"=>"u","ф"=>"f","х"=>"h", "ц"=>"c","ч"=>"ch","ш"=>"sh","щ"=>"w","ъ"=>"y", "ы"=>"i","ь"=>"","э"=>"e","ю"=>"ju","я"=>"ja", " "=> "-", "."=> "", "/"=> "-", "-" => "-");
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Ivanko

  • *****
  • 388 posts
Re: ERORR in formating PHP for cyrilic
« Reply #2 on: June 16, 2021, 04:15:06 PM »
@Ivanko
what chars are below ) ?
ѓ , љ , њ, € ... etc

Checking code you've posted and they are not mentioned here.
Code: [Select]
$chars = array( "А"=>"a","Б"=>"b","В"=>"v","Г"=>"g", "Д"=>"d","Е"=>"e","Ж"=>"z","З"=>"z","И"=>"i", "Й"=>"j","К"=>"k","Л"=>"l","М"=>"m","Н"=>"n", "О"=>"o","П"=>"p","Р"=>"r","С"=>"s","Т"=>"t", "У"=>"u","Ф"=>"f","Х"=>"h","Ц"=>"c","Ч"=>"ch", "Ш"=>"sh","Щ"=>"w","Ъ"=>"","Ы"=>"i","Ь"=>"", "Э"=>"e","Ю"=>"ju","Я"=>"ja","а"=>"a","б"=>"b", "в"=>"v","г"=>"g","д"=>"d","е"=>"e", "ё"=>"e","ж"=>"z", "з"=>"z","и"=>"i","й"=>"j","к"=>"k","л"=>"l", "м"=>"m","н"=>"n","о"=>"o","п"=>"p","р"=>"r", "с"=>"s","т"=>"t","у"=>"u","ф"=>"f","х"=>"h", "ц"=>"c","ч"=>"ch","ш"=>"sh","щ"=>"w","ъ"=>"y", "ы"=>"i","ь"=>"","э"=>"e","ю"=>"ju","я"=>"ja", " "=> "-", "."=> "", "/"=> "-", "-" => "-");

ѓ , љ , њ, € ... etc

those wrong chars are in the last osclass ver 4.4.0,  inside in file formatting.php

*

MB Themes

Re: ERORR in formating PHP for cyrilic
« Reply #3 on: June 17, 2021, 08:33:02 AM »
@Ivanko
I still do not understand, what is wrong on € ?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Ivanko

  • *****
  • 388 posts
Re: ERORR in formating PHP for cyrilic
« Reply #4 on: June 19, 2021, 02:07:29 PM »
@Ivanko
I still do not understand, what is wrong on € ?
The chars what you use in formatting.php for ru-ru  are not existing in ru alphabet.
Please replace chars with what i have provided.

ѓ , љ , њ, € ... etc
Those chars above are not exist, it is more looks as ehieroglyphs))

There are many miss matches

 $cyr = array('а','б','в','г','д','ѓ','е','ж','з','ѕ','и','ј','к','л','љ','м','н','њ','о','п','р','с','т','ќ','у','ф','х','ц','ч','џ','ш','А','Б','В','Г','Д','Ѓ','Е','Ж','З','Ѕ','И','Ј','К','Л','Љ','М','Н','Њ','О','П','Р','С','Т','Ќ','У','Ф','Х','Ц','Ч','Џ','Ш','€')

In red ink are not existing letters in RU alphabet

Also you have 31 chars, must be 33, 2 letters are gone )

https://ru.wikipedia.org/wiki/%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9_%D0%B0%D0%BB%D1%84%D0%B0%D0%B2%D0%B8%D1%82
« Last Edit: June 19, 2021, 02:39:24 PM by Ivanko »

*

MB Themes

Re: ERORR in formating PHP for cyrilic
« Reply #5 on: June 21, 2021, 09:45:58 AM »
@Ivanko
We are not trying to do cyrilic for Russia only/or/separately.
https://en.wikipedia.org/wiki/Gje
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Ivanko

  • *****
  • 388 posts
Re: ERORR in formating PHP for cyrilic
« Reply #6 on: June 21, 2021, 12:31:03 PM »
@Ivanko
We are not trying to do cyrilic for Russia only/or/separately.
https://en.wikipedia.org/wiki/Gje
Then you can include all 53 letters Slavic and not 31
€ - this also not part of cyrilic)



« Last Edit: June 21, 2021, 12:33:14 PM by Ivanko »

*

MB Themes

Re: ERORR in formating PHP for cyrilic
« Reply #7 on: June 21, 2021, 02:28:16 PM »
@Ivanko
There does not make sense to be strict what is and what is not cyrilic, but what may be in URL and what should not be there :)
I think having € sign is not good as well.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Ivanko

  • *****
  • 388 posts
Re: ERORR in formating PHP for cyrilic
« Reply #8 on: June 21, 2021, 07:12:53 PM »
@Ivanko
There does not make sense to be strict what is and what is not cyrilic, but what may be in URL and what should not be there :)
I think having € sign is not good as well.
This is a key - missed letters in last osclass core not making correct url...

Let me know if you plan to fix it ?

Or I can proved full translite and you can add it in next update, so we can fix the bug.

*

MB Themes

Re: ERORR in formating PHP for cyrilic
« Reply #9 on: June 21, 2021, 08:52:06 PM »
@ivanko
Please only provide new letters and their mapping.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Ivanko

  • *****
  • 388 posts
Re: ERORR in formating PHP for cyrilic
« Reply #10 on: June 25, 2021, 05:04:18 PM »
Code: [Select]
$str = "А а Б б В в Г г Ґ ґ Д д Ђ ђ Е е Ё ё Ж ж З з З́ з́ И и Й й Ѝ ѝ І і Ї ї Ј ј К к Л л Љ љ М м Н н Њ њ О о Ō ō П п Р р С с С́ с́ Т т Ћ ћ Ќ ќ У у Ӯ ӯ Ў ў Ф ф Х х Ц ц Ч ч Џ џ Ш ш Щ щ Ъ ъ Ы ы Ь ь Э э Ю ю Я я";
$map ="A a B b V v G g Gj gj D d Dz dz E e Jo jo Zh zh Z z Z z I i J j J j J j J j J j K k L l Lj lj M m N n Nj nj O o O o P p R r S s S s T t T t Kj kj U u U u U u F f H h C c Ch ch Dzh dzh Sh sh Shh shh ## # Y y '' ' Je je Ju ju Ja ja";

97 elements without zero )

space is separator.

*

MB Themes

Re: ERORR in formating PHP for cyrilic
« Reply #11 on: June 27, 2021, 01:36:02 PM »
@Ivanko
Please send it in one of format used by osclass right now.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Ivanko

  • *****
  • 388 posts
Re: ERORR in formating PHP for cyrilic
« Reply #12 on: June 28, 2021, 11:00:45 AM »
Code: [Select]
// update cyrilic to latin
$cyr = array('А','а','Б','б','В','в','Г','г','Ґ','ґ','Д','д','Ђ','ђ','Е','е','Ё','ё','Ж','ж','З','з','З́','з́','И','и','Й','й','Ѝ','ѝ','І','і','Ї','ї','Ј','ј','К','к','Л','л','Љ','љ','М','м','Н','н','Њ','њ','О','о','Ō','ō','П','п','Р','р','С','с','С́','с́','Т','т','Ћ','ћ','Ќ','ќ','У','у','Ӯ','ӯ','Ў','ў','Ф','ф','Х','х','Ц','ц','Ч','ч','Џ','џ','Ш','ш','Щ','щ','Ъ','ъ','Ы','ы','Ь','ь','Э','э','Ю','ю','Я','я');
$lat = array('A','a','B','b','V','v','G','g','Gj','gj','D','d','Dz','dz','E','e','Jo','jo','Zh','zh','Z','z','Z','z','I','i','J','j','J','j','J','j','J','j','J','j','K','k','L','l','Lj','lj','M','m','N','n','Nj','nj','O','o','O','o','P','p','R','r','S','s','S','s','T','t','T','t','Kj','kj','U','u','U','u','U','u','F','f','H','h','C','c','Ch','ch','Dzh','dzh','Sh','sh','Shh','shh','##','#','Y','y','\'\'','\'','Je','je','Ju','ju','Ja','ja');

« Last Edit: June 28, 2021, 11:02:41 AM by Ivanko »

*

MB Themes

Re: ERORR in formating PHP for cyrilic
« Reply #13 on: June 28, 2021, 01:34:34 PM »
@Ivanko
Thank you, are you sure these signs should be in URL ?
Code: [Select]
'##','#','\'\'','\'',
Does not look correct for me.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Ivanko

  • *****
  • 388 posts
Re: ERORR in formating PHP for cyrilic
« Reply #14 on: June 28, 2021, 02:11:37 PM »
@Ivanko
Thank you, are you sure these signs should be in URL ?
Code: [Select]
'##','#','\'\'','\'',
Does not look correct for me.
Hi it is correct

## - capital letter
# - small letter
'' - capital letter ( backslash is php separator)
' - small letter (same here backslash as php separator)

here is also an example of general translit
https://translit.net/


as array should looks like below
Code: [Select]
$str = "А а Б б В в Г г Ґ ґ Д д Ђ ђ Е е Ё ё Ж ж З з З́ з́ И и Й й Ѝ ѝ І і Ї ї Ј ј К к Л л Љ љ М м Н н Њ њ О о Ō ō П п Р р С с С́ с́ Т т Ћ ћ Ќ ќ У у Ӯ ӯ Ў ў Ф ф Х х Ц ц Ч ч Џ џ Ш ш Щ щ Ъ ъ Ы ы Ь ь Э э Ю ю Я я";
$str = preg_replace('#\s+#',',',trim($str));
$myArray = explode(',', $str);

$map ="A a B b V v G g Gj gj D d Dz dz E e Jo jo Zh zh Z z Z z I i J j J j J j J j J j K k L l Lj lj M m N n Nj nj O o O o P p R r S s S s T t T t Kj kj U u U u U u F f H h C c Ch ch Dzh dzh Sh sh Shh shh ## # Y y '' ' Je je Ju ju Ja ja";
$map= preg_replace('#\s+#',',',trim($map));
$myArray2 = explode(',', $map);


by the way, you can add in the end this letter є and map je , this letter existing in Ukrainian alphabet  ::)
« Last Edit: June 28, 2021, 02:28:50 PM by Ivanko »