sindresorhus / slugify

Slugify a string
MIT License
2.56k stars 81 forks source link

Splitting languages into loadable dictionaries and adding Swedish language #38

Closed adrael closed 4 years ago

adrael commented 5 years ago

Hello @sindresorhus !

This PR improves the management of languages through dictionaries. Users can now explicitly load the dictionary-ies they need to properly slugify their data.

This PR was needed because of languages overlapping. For example, Swedish and German have common chars (such as Ä), and thus the wrong replacements were made.

It is now fixed, and thus fixes #33

Also, this PR adds support for a lot of new languages, with according tests, to amend long-pending PRs:

Thanks for the good work!

sindresorhus commented 4 years ago

Instead of the user having to manually load the wanted dictionaries, I think it would be better if the user could just provide a language hint, for example, sv-SE to prioritize the swedish replacement. And adding Swedish should be a separate PR from splitting up the languages. And sorry for the late reply. I just got busy.