Arabic Language
See original GitHub issueHello,
How can I slugify transform this:
السلام عليكم ورحمة الله وبركاته
Into this:
السلام-عليكم-ورحمة-الله-وبركاته
shall I add the Arabic characters to charmap.json
as below ?
{
"أ": "أ",
"ب": "ب",
"ت": "ت",
"ث": "ث",
"ج": "ج",
"ح": "ح"
}
and so on ?
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Arabic - Wikipedia
Arabic is a Semitic language spoken primarily across the Arab world. Having emerged in the 1st century, it is named after the Arab...
Read more >Arabic language | History & Alphabet - Britannica
Arabic language, Semitic language spoken in a large area including North Africa, most of the Arabian Peninsula, and other parts of the Middle...
Read more >The Evolution of the Arabic language in the Silk Roads
Arabic, which first emerged in the northwest of the Arabian Peninsula, is a member of the Semitic family of languages which also includes...
Read more >Arabic (Overview) - MustGo.com
Arabic (al-'arabiyyah, العربية) is a macrolanguage. As the largest member of the Semitic branch of the Afro-Asiatic language family it includes all ...
Read more >The Arabic Language
Arabic belongs to the Semitic language family, and is hence closely related to Amharic (spoken in Ethiopia) and Hebrew. Modern Standard Arabic (MSA)...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was about to start working on this feature but I noticed that the issue comes from the default
remove
regex:This regex removes anything that’s not in that list, meaning it preserves only the listed characters. The
\w
flag stands for thea-zA-Z
range, meaning anything except those characters will be removed.So instead we can update the
remove
regex to remove only the listed characters:And this yields the expected result:
If you’re not trying to get a Latin alphabet result and if you know that your input strings will use a single alphabet, I imagine using
String.prototype.replace()
might be easier (and have a smaller code footprint) than usingslugify()
.