From 7a090780e297c7a9de96af23c9997df7dde3280a Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Sun, 23 Aug 2020 13:10:36 +0200 Subject: [PATCH 1/2] Set LANGUAGE_CODE=en The LANGUAGE_CODE is used to switch on a language with the new language toggles by default and also to select the localized title field to create the slag from. In both places, "en-us" is not parsed downs to "en". Avoid trouble by using "en" for the LANGUAGE_CODE. --- config/settings/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/settings/base.py b/config/settings/base.py index 36d0187..625ea01 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -12,7 +12,7 @@ # GENERAL # ------------------------------------------------------------------------------ TIME_ZONE = 'Europe/Berlin' -LANGUAGE_CODE = 'en-us' +LANGUAGE_CODE = 'en' SITE_ID = 1 USE_I18N = True USE_L10N = True From 507a0919aa62c396d3757010dd44fd58fc2e7d3b Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Sun, 23 Aug 2020 21:19:06 +0200 Subject: [PATCH 2/2] Add patch to Fix autogenerated slugs --- patches/Fix-autogenerated-slugs.patch | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 patches/Fix-autogenerated-slugs.patch diff --git a/patches/Fix-autogenerated-slugs.patch b/patches/Fix-autogenerated-slugs.patch new file mode 100644 index 0000000..15818d2 --- /dev/null +++ b/patches/Fix-autogenerated-slugs.patch @@ -0,0 +1,29 @@ +From 35449e448200598d5b002d8e55ab8ece9ede0217 Mon Sep 17 00:00:00 2001 +From: Donald Buczek +Date: Sun, 23 Aug 2020 21:17:21 +0200 +Subject: [PATCH] Fix autogenerated slugs + +Fix bug in wagtail_modeltranslation which disables the autogeneration of +slugs. + +See https://github.com/infoportugal/wagtail-modeltranslation/issues/293 +--- + .../site-packages/wagtail_modeltranslation/wagtail_hooks.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/python3.7/site-packages/wagtail_modeltranslation/wagtail_hooks.py b/lib/python3.7/site-packages/wagtail_modeltranslation/wagtail_hooks.py +index 1bbff88..3b3d61f 100644 +--- a/lib/python3.7/site-packages/wagtail_modeltranslation/wagtail_hooks.py ++++ b/lib/python3.7/site-packages/wagtail_modeltranslation/wagtail_hooks.py +@@ -54,7 +54,7 @@ def translated_slugs(): + languages: [{languages}], + defaultLanguage: '{language_code}', + viewEditString: '{view_edit_string}', +- translate_slugs: '{translate_slugs}', ++ translate_slugs: {translate_slugs}, + }}; + + """.format( +-- +2.26.2 +