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

Add option to include non-latin characters #80

Open
grmmph opened this issue Jul 11, 2016 · 7 comments
Open

Add option to include non-latin characters #80

grmmph opened this issue Jul 11, 2016 · 7 comments
Assignees

Comments

@grmmph
Copy link

grmmph commented Jul 11, 2016

First of all, awesome library!

I would like to open a discussion for adding an option to support for non-latin characters.
As far as I see it, 99% of browsers would parse this example correctly without messing up the route:

http://www.my-site.com/article/עוגת-בננה-זה-טעים-מאוד
http://www.my-site.com/article/香蕉蛋糕都不错
http://www.my-site.com/article/كعكة-الموز-جيدة

If there's any reason this shouldn't be allowed, I would really like to learn why.

Thanks!

@grmmph grmmph changed the title Add options to include non-latin characters Add option to include non-latin characters Jul 11, 2016
@leocaseiro
Copy link

leocaseiro commented Jul 11, 2016

The speakingurl already supports Arabic and Burmese chars as well.

I believe if you send a Pull Request with support for the others languages you need, it's will be very welcome for this repo.

@leocaseiro
Copy link

leocaseiro commented Jul 11, 2016

PS: Maybe the answer #61 which mention about the limax library will be related to this issue.

@grmmph
Copy link
Author

grmmph commented Jul 11, 2016

@leocaseiro This converts Arabic characters to latin characters. Not so good for seo

@pid
Copy link
Owner

pid commented Jul 11, 2016

As far as I see it, 99% of browsers would parse this example correctly without messing up the route:
If there's any reason this shouldn't be allowed, I would really like to learn why.

If you don't need transliterated URLs, go with it :-) otherwise you can use speakingurl
That speakingurl is available, means not, that you have to transliterate your URLs ;-)

I would like to open a discussion for adding an option to support for non-latin characters.

That's a good point, to support non-latin characters as-is, and only replace special characters.
I will add this on the todo list, thanks

@pid pid self-assigned this Jul 11, 2016
@grmmph
Copy link
Author

grmmph commented Jul 11, 2016

Thanks @pid!

Can you think on top of your head of a Regex phrase that might do the trick?

@pid
Copy link
Owner

pid commented Jul 11, 2016

Can you think on top of your head of a Regex phrase that might do the trick?
obviously... but I will check

@grmmph
Copy link
Author

grmmph commented Jul 11, 2016

Perhaps something like this:

[\u0590-\u05FF\u0600-\u06FF\u0400-\u04FF\w\s\d]

This covers hebrew, arabic and Cyrillic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants