Slug as in wikipedia

I want to make urls as in wikipedia. What regex should I use? What slug generator should I use?
I want to allow utf-8 letters (latin and non-latin) to be present in the urls.

I do not know the wikipedia way but I usually go with cocur/slugify. hope his helps

If I understand right cocur/slugify do transliteration for any utf-8 (non-latin) symbols. Am I right?

Looks like it does yes

from the doc, it provides custom replacements for Arabic, Austrian, Azerbaijani, Bulgarian, Burmese, Croatian, Czech, Esperanto, Estonian, Finnish, French, Georgian, German, Greek, Hindi, Italien, Latvian, Lithuanian, Norwegian, Polish, Romanian, Russian, Serbian, Spanish, Swedish, Turkish, Ukrainian and Vietnamese special characters.

Instead of removing these characters, Slugify approximates them

suggest: give it a try and open an issue on its GitHub if you need any other language to be supported

1 Like

I just want leave listed languages without transliteration. Thank you for pointing.