diff --git a/Resources/rules/norwegian.json b/Resources/rules/norwegian.json new file mode 100644 index 00000000..66000ba1 --- /dev/null +++ b/Resources/rules/norwegian.json @@ -0,0 +1,8 @@ +{ + "Æ": "AE", + "Ø": "OE", + "Å": "AA", + "æ": "ae", + "ø": "oe", + "å": "aa" +} diff --git a/src/RuleProvider/DefaultRuleProvider.php b/src/RuleProvider/DefaultRuleProvider.php index 1114c93a..f82f650f 100644 --- a/src/RuleProvider/DefaultRuleProvider.php +++ b/src/RuleProvider/DefaultRuleProvider.php @@ -443,6 +443,15 @@ class DefaultRuleProvider implements RuleProviderInterface 'ჯ' => 'j', 'ჰ' => 'h', ), + 'norwegian' => + array ( + 'Æ' => 'AE', + 'Ø' => 'OE', + 'Å' => 'AA', + 'æ' => 'ae', + 'ø' => 'oe', + 'å' => 'aa' + ), 'german' => array ( 'Ä' => 'AE', diff --git a/src/Slugify.php b/src/Slugify.php index 300e4e62..a8c8b5a1 100644 --- a/src/Slugify.php +++ b/src/Slugify.php @@ -52,6 +52,7 @@ class Slugify implements SlugifyInterface 'burmese', 'hindi', 'georgian', + 'norwegian', 'vietnamese', 'ukrainian', 'latvian', diff --git a/tests/SlugifyTest.php b/tests/SlugifyTest.php index c9f83f79..75811944 100644 --- a/tests/SlugifyTest.php +++ b/tests/SlugifyTest.php @@ -170,6 +170,7 @@ public function defaultRuleProvider() ['Mężny bądź chroń pułk twój i sześć flag', 'mezny-badz-chron-pulk-twoj-i-szesc-flag'], ['ერთი ორი სამი ოთხი ხუთი', 'erti-ori-sami-otkhi-khuti'], ['अ ऒ न द', 'a-oii-na-tha'], + ['Æ Ø Å æ ø å', 'ae-oe-aa-ae-oe-aa'], [str_repeat('Übergrößenträger', 1000), str_repeat('uebergroessentraeger', 1000)], [str_repeat('my🎉', 5000), substr(str_repeat('my-', 5000), 0, -1)], [str_repeat('hi🇦🇹', 5000), substr(str_repeat('hi-', 5000), 0, -1)],