Replaces special characters in a string so that it may be used as part of a ‘pretty’ URL. Supports any language.
Add ex_parameterize
to your list of dependencies in mix.exs
:
def deps do
[{:ex_parameterize, "~> 1.0"}]
end
Update your dependencies:
$ mix deps.get
Parameterize.parameterize("Привет, Мир!")
"privet-mir"
Parameterize.parameterize("Hello, World!")
"hello-world"
Parameterize.parameterize("ሰላም ልዑል")
"salaame-leule"
Parameterize.parameterize("🍕")
nil
Parameterize is released under MIT license.
-
Inspired by Slugify and Transliteration
-
Data ported from andyhu's excellent Transliteration package.