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 Slovak rules #230

Merged
merged 3 commits into from Nov 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 36 additions & 0 deletions Resources/rules/slovak.json
@@ -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
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
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
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