thedevdojo / voyager

Voyager - The Missing Laravel Admin
https://voyager.devdojo.com
MIT License
11.78k stars 2.67k forks source link

Slugify for Voyager - Russian map #3027

Closed Margo57 closed 4 years ago

Margo57 commented 6 years ago

Description:

In Russian, "ь": "" and "ъ": "", but they are replaced by "-". It is not right! Печенье = Pechene, not Pechen-e...

Steps To Reproduce:

taiwanleaftea commented 4 years ago

I have the same issue in the latest version of Voyager.

Workaround

_map_russian function in resources/assets/js/slugify.js for Russian language contains this for 'ъ', 'ь', 'Ъ', 'Ь':

` _map_russian: function() { return { 'ъ':'', 'ь':'', 'Ъ':'', 'Ь':''

}; },` So **_slug += (this.chars[str.charAt(i)]) ? this.chars[str.charAt(i)] : str.charAt(i)** doesn't replace those letters, and the letters are replaced later for '-' in this regexp **replace(/[^a-z0-9]/g, _sep)** Adding this regexp **replace(/[ьЬъЪ]/g, "")** solve the problem.
github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.