Creating slug from russian string with symfony/string add extra seperators

use SymfonyComponentStringSluggerAsciiSlugger;

require '../../vendor/autoload.php';

$s = new AsciiSlugger('ru');
$str = 'стараться';
echo $s->slug($str)->lower();

This code use russian-latin/bgn transliteration rules from php intl extension inside symfony.

The problem is that it adds extra separator between t and s symbols due to extended rules.

starat-sya

I found that exists simplified russian-latin/bgn rules, but I can’t realise how to configure it or does it implemented in intl extension.

Is there any solutions?

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *