Skip to content
Permalink
Browse files

Add languages Persian, Pashto and Urdu (#22)

  • Loading branch information...
MHM5000 authored and sindresorhus committed Jan 14, 2019
1 parent 327eb27 commit 24917549c11e7b3cd9464259983de9b46dab1601
Showing with 56 additions and 0 deletions.
  1. +44 −0 replacements.js
  2. +12 −0 test.js
@@ -195,8 +195,52 @@ module.exports = [
['٥', '5'],
['٦', '6'],
['٧', '7'],
['٨', '8'],
['٩', '9'],

// Persian / Farsi
['چ', 'ch'],
['ک', 'k'],
['گ', 'g'],
['پ', 'p'],
['ژ', 'zh'],
['ی', 'y'],
['۰', '0'],
['۱', '1'],
['۲', '2'],
['۳', '3'],
['۴', '4'],
['۵', '5'],
['۶', '6'],
['۷', '7'],
['۸', '8'],
['۹', '9'],

// Pashto
['ټ', 'p'],
['ځ', 'z'],
['څ', 'c'],
['ډ', 'd'],
['', 'd'],
['', 'r'],
['ړ', 'r'],
['', 'z'],
['ږ', 'g'],
['ښ', 'x'],
['ګ', 'g'],
['ڼ', 'n'],
['ۀ', 'e'],
['ې', 'e'],
['ۍ', 'ai'],

// Urdu
['ٹ', 't'],
['ڈ', 'd'],
['ڑ', 'r'],
['ں', 'n'],
['ہ', 'h'],
['ھ', 'h'],
['ے', 'e'],

// Russian
['А', 'A'],
12 test.js
@@ -94,6 +94,18 @@ test('supports Arabic', t => {
t.is(slugify('ث س و', {lowercase: false, separator: ' '}), 'th s w');
});

test('supports Persian / Farsi', t => {
t.is(slugify('چ ی پ', {lowercase: false, separator: ' '}), 'ch y p');
});

test('supports Urdu', t => {
t.is(slugify('ٹ ڈ ھ', {lowercase: false, separator: ' '}), 't d h');
});

test('supports Pashto', t => {
t.is(slugify('ګ ړ څ', {lowercase: false, separator: ' '}), 'g r c');
});

test('supports Russian', t => {
t.is(slugify('Ж п ю', {lowercase: false, separator: ' '}), 'Zh p yu');
});

0 comments on commit 2491754

Please sign in to comment.
You can’t perform that action at this time.