add slovak character map for js slug generation

Porting of Django PR , which fixes Django ticket . These
changes were made in Django 2.1.

This adds support for certain Slovak characters when auto-generating
slugs for new pages. This logic is only triggered if
settings.WAGTAIL_ALLOW_UNICODE_SLUGS is set to False; see

http://docs.wagtail.io/en/v2.1.1/advanced_topics/settings.html#unicode-page-slugs

To test, create a new page and enter a title like "Vŕba". The
page's slug field will be automatically set to "vrba". In the
previous behavior, this would instead be automatically set to "vba".

https://github.com/django/django/pull/9325
https://code.djangoproject.com/ticket/28768
pull/4915/head
Andy Chosak 2018-11-14 09:41:45 -05:00 zatwierdzone przez Matt Westcott
rodzic e8c88d44af
commit 17fc5cc913
3 zmienionych plików z 11 dodań i 0 usunięć
docs/releases
wagtail/admin/static_src/wagtailadmin/js/vendor

Wyświetl plik

@ -13,6 +13,7 @@ Changelog
* Added `file_hash` field to documents (Karl Hobley, Dan Braghis)
* Added last login to the user overview (Noah B Johnson)
* Changed design of image editing page (Janneke Janssen, Ben Enright)
* Added Slovak character map for JavaScript slug generation (Andy Chosak)
* Fix: Query objects returned from `PageQuerySet.type_q` can now be merged with `|` (Brady Moe)
* Fix: Add `rel="noopener noreferrer"` to target blank links (Anselm Bradford)
* Fix: Additional fields on custom document models now show on the multiple document upload view (Robert Rollins, Sergey Fedoseev)

Wyświetl plik

@ -31,6 +31,7 @@ Other features
* Added ``file_hash`` field to documents (Karl Hobley, Dan Braghis)
* Added last login to the user overview (Noah B Johnson)
* Changed design of image editing page (Janneke Janssen, Ben Enright)
* Added Slovak character map for JavaScript slug generation (Andy Chosak)
Bug fixes
~~~~~~~~~

Wyświetl plik

@ -58,6 +58,14 @@
'ů': 'u', 'ž': 'z', 'Č': 'C', 'Ď': 'D', 'Ě': 'E', 'Ň': 'N', 'Ř': 'R',
'Š': 'S', 'Ť': 'T', 'Ů': 'U', 'Ž': 'Z'
};
var SLOVAK_MAP = {
'á': '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'
};
var POLISH_MAP = {
'ą': 'a', 'ć': 'c', 'ę': 'e', 'ł': 'l', 'ń': 'n', 'ó': 'o', 'ś': 's',
'ź': 'z', 'ż': 'z',
@ -108,6 +116,7 @@
RUSSIAN_MAP,
UKRAINIAN_MAP,
CZECH_MAP,
SLOVAK_MAP,
POLISH_MAP,
LATVIAN_MAP,
ARABIC_MAP,