diff --git a/wagtail_localize/templates/wagtail_localize/admin/edit_translation.html b/wagtail_localize/templates/wagtail_localize/admin/edit_translation.html index 41b323ad..ef29dd4f 100644 --- a/wagtail_localize/templates/wagtail_localize/admin/edit_translation.html +++ b/wagtail_localize/templates/wagtail_localize/admin/edit_translation.html @@ -13,7 +13,9 @@ {% endblock %} {% block extra_css %} - {% include "wagtailadmin/pages/_editor_css.html" %} + {% if has_editor_css %} + {% include "wagtailadmin/pages/_editor_css.html" %} + {% endif %} {% endblock %} {% block extra_js %} diff --git a/wagtail_localize/views/edit_translation.py b/wagtail_localize/views/edit_translation.py index 427b08c4..a2669d94 100644 --- a/wagtail_localize/views/edit_translation.py +++ b/wagtail_localize/views/edit_translation.py @@ -63,9 +63,7 @@ if WAGTAIL_VERSION >= (4, 0): - from wagtail.snippets.views.snippets import ( - get_snippet_panel as get_snippet_edit_handler, - ) + from wagtail.admin.panels import get_edit_handler as get_snippet_edit_handler else: from wagtail.snippets.views.snippets import get_snippet_edit_handler @@ -1043,6 +1041,7 @@ def get_translation_progress(segment, locale): }, cls=DjangoJSONEncoder, ), + "has_editor_css": WAGTAIL_VERSION <= (4, 0), }, )