March 2020
Intermediate to advanced
608 pages
17h 17m
English
The default Django slugify() function handles German diacritical symbols incorrectly. To see this for yourself, try to slugify a very long German word with all the German diacritical symbols. First, run the following code in the Django shell, without the monkey patch:
(env)$ python manage.py shell>>> from django.utils.text import slugify>>> slugify("Heizölrückstoßabdämpfung")'heizolruckstoabdampfung'
This is incorrect in German, as the letter ß is totally stripped out instead of being substituted for ss and the letters ä, ö, and ü are changed to a, o, and u, where they should have been substituted with ae, oe, and ue.
The monkey patch that we created loads the django.utils.text module at initialization and reassigns transliteration.slugify ...
Read now
Unlock full access