I've tried to use this recipe to create custom modal.
When I create new page with cyrillic title, @slugify-title does not work and new page can't create.


Slug rules in blueprints do not give any effect
I've also tried to use widget plugin with same functionality but it also doesn't work. Grav creates page only with single dash

Pretty sure slugify only works for alphanumeric characters, and not cyrillic ones.
I need to see if the 3rd party plugin we are using has added support for i8n languages.
We might need to move to this one: https://www.npmjs.com/package/slugify
@antonlukin столкнулся с этим же, пока не внесли правки дополнил метод slug
делает проверку на кириллицу, если нашлось, то делает замену
public static function slug($str)
{
//Cyrillic
$contains_cyrillic = (bool) preg_match('/[\p{Cyrillic}]/u', $str);
if ($contains_cyrillic) {
$cyr = [
'а','б','в','г','д','е','ё','ж','з','и','й','к','л','м','н','о','п',
'р','с','т','у','ф','х','ц','ч','ш','щ','ъ','ы','ь','э','ю','я',
'А','Б','В','Г','Д','Е','Ё','Ж','З','И','Й','К','Л','М','Н','О','П',
'Р','С','Т','У','Ф','Х','Ц','Ч','Ш','Щ','Ъ','Ы','Ь','Э','Ю','Я'
];
$lat = [
'a','b','v','g','d','e','e','zh','z','i','y','k','l','m','n','o','p',
'r','s','t','u','f','h','c','ch','sh','sh','a','i','y','e','yu','ya',
'A','B','V','G','D','E','Io','Zh','Z','I','Y','K','L','M','N','O','P',
'R','S','T','U','F','H','Ts','Ch','Sh','Sht','A','I','Y','e','Yu','Ya'
];
$str = str_replace($cyr, $lat, $str);
}
if (function_exists('transliterator_transliterate')) {
$str = transliterator_transliterate('Any-Latin; NFD; [:Nonspacing Mark:] Remove; NFC; [:Punctuation:] Remove;', $str);
} else {
$str = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str);
}
$str = strtolower($str);
$str = preg_replace('/[-\s]+/', '-', $str);
$str = preg_replace('/[^a-z0-9-]/i', '', $str);
$str = trim($str, '-');
return $str;
}
Can you paste here the slug you have in your screenshot in cyrillic?
When I try some cyrillic title, the slug seems to work just fine, it does get converted to latin but it works as expected:

NOTE that I also tried using slugify instead of our current solution, and it does the same thing on converting cyrillic to latin like in my screenshot above.
@slugify, nor @slugify-title both not working when using custom page creation modal from Admin recipes.
@w00fz, try in a custom modal, then you will see this problem.
Added Kazakh letters to @squidy71 workaround:
public static function slug($str)
{
//Cyrillic
$contains_cyrillic = (bool) preg_match('/[\p{Cyrillic}]/u', $str);
if ($contains_cyrillic) {
$cyr = [
'а','б','в','г','д','е','ё','ж','з','и','й','к','л','м','н','о','п',
'р','с','т','у','ф','х','ц','ч','ш','щ','ъ','ы','ь','э','ю','я',
'А','Б','В','Г','Д','Е','Ё','Ж','З','И','Й','К','Л','М','Н','О','П',
'Р','С','Т','У','Ф','Х','Ц','Ч','Ш','Щ','Ъ','Ы','Ь','Э','Ю','Я',
// Kazakh letters
'ә','ғ','қ','ң','ө','ұ','ү','һ','і'
];
$lat = [
'a','b','v','g','d','e','e','zh','z','i','y','k','l','m','n','o','p',
'r','s','t','u','f','h','c','ch','sh','sh','a','i','y','e','yu','ya',
'A','B','V','G','D','E','Io','Zh','Z','I','Y','K','L','M','N','O','P',
'R','S','T','U','F','H','Ts','Ch','Sh','Sht','A','I','Y','e','Yu','Ya',
// Kazakh letters
'a','gh','q','ng','o','u','u','h','i'
];
$str = str_replace($cyr, $lat, $str);
}
if (function_exists('transliterator_transliterate')) {
$str = transliterator_transliterate('Any-Latin; NFD; [:Nonspacing Mark:] Remove; NFC; [:Punctuation:] Remove;', $str);
} else {
$str = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str);
}
$str = strtolower($str);
$str = preg_replace('/[-\s]+/', '-', $str);
$str = preg_replace('/[^a-z0-9-]/i', '', $str);
$str = trim($str, '-');
return $str;
}
Dear Devs, please add the code suggested above or suggest your solution, we need to fix this bug.
Bump this issue!
Most helpful comment
@antonlukin столкнулся с этим же, пока не внесли правки дополнил метод slug
делает проверку на кириллицу, если нашлось, то делает замену