Skip to content

Commit

Permalink
Merge pull request #230 from bartko-s/slovak-rules
Browse files Browse the repository at this point in the history
Add Slovak rules
  • Loading branch information
florianeckerstorfer authored Nov 26, 2019
2 parents 7fb0399 + f616abc commit ed496e9
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Resources/rules/slovak.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"Á": "A",
"Ä": "A",
"Č": "C",
"Ď": "D",
"É": "E",
"Í": "I",
"Ĺ": "L",
"Ľ": "L",
"Ň": "N",
"Ó": "O",
"Ô": "O",
"Ŕ": "R",
"Š": "S",
"Ť": "T",
"Ú": "U",
"Ý": "Y",
"Ž": "Z",
"á": "a",
"ä": "a",
"č": "c",
"ď": "d",
"é": "e",
"í": "i",
"ĺ": "l",
"ľ": "l",
"ň": "n",
"ó": "o",
"ô": "o",
"ŕ": "r",
"š": "s",
"ť": "t",
"ú": "u",
"ý": "y",
"ž": "z"
}
37 changes: 37 additions & 0 deletions src/RuleProvider/DefaultRuleProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8359,6 +8359,43 @@ class DefaultRuleProvider implements RuleProviderInterface
'Ć' => 'C',
'Č' => 'C',
),
'slovak' =>
array(
"Á" => "A",
"Ä" => "A",
"Č" => "C",
"Ď" => "D",
"É" => "E",
"Í" => "I",
"Ĺ" => "L",
"Ľ" => "L",
"Ň" => "N",
"Ó" => "O",
"Ô" => "O",
"Ŕ" => "R",
"Š" => "S",
"Ť" => "T",
"Ú" => "U",
"Ý" => "Y",
"Ž" => "Z",
"á" => "a",
"ä" => "a",
"č" => "c",
"ď" => "d",
"é" => "e",
"í" => "i",
"ĺ" => "l",
"ľ" => "l",
"ň" => "n",
"ó" => "o",
"ô" => "o",
"ŕ" => "r",
"š" => "s",
"ť" => "t",
"ú" => "u",
"ý" => "y",
"ž" => "z",
),
'swedish' =>
array (
'Ä' => 'A',
Expand Down
1 change: 1 addition & 0 deletions src/Slugify.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Slugify implements SlugifyInterface
'greek',
'czech',
'arabic',
'slovak',
'turkish',
'polish',
'german',
Expand Down
1 change: 1 addition & 0 deletions tests/SlugifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public function customRulesProvider()
['danish', 'Æ æ Ø ø Å å É é', 'ae-ae-oe-oe-aa-aa-e-e'],
['romanian', 'ă î â ş ș ţ ț Ă Î Â Ş Ș Ţ Ț', 'a-i-a-s-s-t-t-a-i-a-s-s-t-t'],
['serbian', 'А Б В Г Д Ђ Е Ж З И Ј К Л Љ М Н Њ О П Р С Т Ћ У Ф Х Ц Ч Џ Ш а б в г д ђ е ж з и ј к л љ м н њ о п р с т ћ у ф х ц ч џ ш Š Đ Ž Ć Č š đ ž ć č', 'a-b-v-g-d-dj-e-z-z-i-j-k-l-lj-m-n-nj-o-p-r-s-t-c-u-f-h-c-c-dz-s-a-b-v-g-d-dj-e-z-z-i-j-k-l-lj-m-n-nj-o-p-r-s-t-c-u-f-h-c-c-dz-s-s-dj-z-c-c-s-dj-z-c-c'],
['slovak', 'Á Ä Č Ď É Í Ĺ Ľ Ň Ó Ô Ŕ Š Ť Ú Ý Ž á ä č ď é í ĺ ľ ň ó ô ŕ š ť ú ý ž', 'a-a-c-d-e-i-l-l-n-o-o-r-s-t-u-y-z-a-a-c-d-e-i-l-l-n-o-o-r-s-t-u-y-z'],
['lithuanian', 'Ą Č Ę Ė Į Š Ų Ū Ž ą č ę ė į š ų ū ž', 'a-c-e-e-i-s-u-u-z-a-c-e-e-i-s-u-u-z'],
['estonian', 'Š Ž Õ Ä Ö Ü š ž õ ä ö ü', 's-z-o-a-o-u-s-z-o-a-o-u'],
['hungarian', 'Á É Í Ó Ö Ő Ú Ü Ű á é í ó ö ő ú ü ű', 'a-e-i-o-o-o-u-u-u-a-e-i-o-o-o-u-u-u'],
Expand Down

0 comments on commit ed496e9

Please sign in to comment.