Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

detranslify and slugify #7

Closed
githubjeka opened this issue Oct 23, 2013 · 3 comments · Fixed by #10
Closed

detranslify and slugify #7

githubjeka opened this issue Oct 23, 2013 · 3 comments · Fixed by #10
Labels

Comments

@githubjeka
Copy link
Contributor

  1. Problem:
echo $r = RUtils::translit()->slugify($this->model->obj_connect);
echo RUtils::translit()->detranslify($r);

return "ts" and "ц", original data = "ТС"

  1. Problem with encode $inString = mb_strtolower($inString); in slugify
@githubjeka
Copy link
Contributor Author

I decided to first problem. For this to apply a correct table.

 array('э','je'),     array('ё','jo'),
        array('я','ya'),        array('ю','yu'),
        array('ы','y'),            array('ж','zh'),
        array('й','y'),            array('щ','shch'),        array('ч','ch'),        array('ш','sh'),
        array('э','ea'),        array('а','a'),            array('б','b'),            array('в','v'),        array('г','g'),
        array('д','d'),            array('е','e'),            array('з','z'),            array('и','i'),        array('к','k'),
        array('л','l'),            array('м','m'),            array('н','n'),            array('о','o'),        array('п','p'),
        array('р','r'),            array('с','s'),            array('т','t'),            array('у','u'),        array('ф','f'),
        array('х','h'),            array('ц','c'),            array('э','e'),            array('ь',''),     array('ъ',''),
        array('й','y'),            array('Э','JE'),       array('Ё','JO'),
        array('Я','YA'),
        array('Ю','YU'),
        array('Ы','Y'),
        array('Ж','ZH'),        array('Й','Y'),            array('Щ','SHCH'),        array('Ч','CH'),
        array('Ш','SH'),        array('Э','E'),            array('А','A'),            array('Б','B'),
        array('В','V'),            array('Г','G'),            array('Д','D'),            array('Е','E'),        array('З','Z'),
        array('И','I'),            array('К','K'),            array('Л','L'),            array('М','M'),        array('Н','N'),
        array('О','O'),            array('П','P'),            array('Р','R'),            array('С','S'),        array('Т','T'),
        array('У','U'),            array('Ф','F'),            array('Х','H'),            array('Ц','C'),        array('Э','E'),
        array('Ь',''),              array('Ъ',''),            array('Й','Y'),

Pull Request need ?

@andre487
Copy link
Owner

For first problem, I think will be better if encoding will be set on the module level. At now multibyte strings are using only in this function but it may change in future.

For second: I will be grateful for pull request.

@andre487
Copy link
Owner

I fix first problem in commit d1a773f

andre487 added a commit that referenced this issue Oct 23, 2013
Correct translation table, fix issue #7
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants