Skip to content

Commit

Permalink
Merge pull request #27 from billmn/master
Browse files Browse the repository at this point in the history
Added Arabic support
  • Loading branch information
Florian Eckerstorfer committed Apr 17, 2014
2 parents dee92b5 + 2a01b65 commit 331f5b1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
33 changes: 32 additions & 1 deletion src/Slugify.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ class Slugify implements SlugifyInterface
'ϐ' => 'b',
'ϑ' => 'th',
'ϒ' => 'Y',

// Esperanto
'ĉ' => 'cx',
'ĝ' => 'gx',
Expand All @@ -421,7 +422,37 @@ class Slugify implements SlugifyInterface
'Ĥ' => 'HX',
'Ĵ' => 'JX',
'Ŝ' => 'SX',
'Ŭ' => 'UX'
'Ŭ' => 'UX',

/* Arabic */
'أ' => 'a',
'ب' => 'b',
'ت' => 't',
'ث' => 'th',
'ج' => 'g',
'ح' => 'h',
'خ' => 'kh',
'د' => 'd',
'ذ' => 'th',
'ر' => 'r',
'ز' => 'z',
'س' => 's',
'ش' => 'sh',
'ص' => 's',
'ض' => 'd',
'ط' => 't',
'ظ' => 'th',
'ع' => 'aa',
'غ' => 'gh',
'ف' => 'f',
'ق' => 'k',
'ك' => 'k',
'ل' => 'l',
'م' => 'm',
'ن' => 'n',
'ه' => 'h',
'و' => 'o',
'ي' => 'y'
);

/**
Expand Down
4 changes: 3 additions & 1 deletion tests/SlugifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ public function provider()
array('драма', 'drama'),
array('ελληνικά', 'ellenika'),
array('C’est du français !', 'c-est-du-francais'),
array('serĉi manĝi ĥirurgio ĵurnalo ŝuo malgraŭ', 'sercxi-mangxi-hxirurgio-jxurnalo-sxuo-malgraux')
array('serĉi manĝi ĥirurgio ĵurnalo ŝuo malgraŭ', 'sercxi-mangxi-hxirurgio-jxurnalo-sxuo-malgraux'),
array('هذه هي اللغة العربية', 'hthh-hy-llgh-laarby'),
array('مرحبا العالم', 'mrhb-laa-lm')
);
}
}

0 comments on commit 331f5b1

Please sign in to comment.