Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slugify for Voyager - Russian map #3027

Closed
Margo57 opened this issue Apr 21, 2018 · 2 comments · Fixed by #4901
Closed

Slugify for Voyager - Russian map #3027

Margo57 opened this issue Apr 21, 2018 · 2 comments · Fixed by #4901

Comments

@Margo57
Copy link

Margo57 commented Apr 21, 2018

  • Laravel Version: 5.5
  • Voyager Version: 1.0
  • PHP Version: 7.2
  • Database Driver & Version:

Description:

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

Steps To Reproduce:

@Margo57 Margo57 changed the title Slugify Russian map Slugify for Voyager - Russian map Apr 21, 2018
@taiwanleaftea
Copy link
Contributor

taiwanleaftea commented Apr 6, 2020

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 {<skipped> 'ъ':'', 'ь':'', 'Ъ':'', 'Ь':'' <skipped> }; },

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.

taiwanleaftea added a commit to taiwanleaftea/voyager that referenced this issue Apr 23, 2020
emptynick added a commit that referenced this issue May 17, 2020
fixes #3027

Co-authored-by: Christoph Schweppe <info@cschweppe.de>
@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants