-
I don't want the editors to need to menu around to manually sync the translations on all pages they edit. Can this be done automatically on page edit? |
Beta Was this translation helpful? Give feedback.
Answered by
chris48s
May 14, 2022
Replies: 1 comment
-
It doesn't exist in core or localize out of the box, but you could implement what you're suggesting with a small hook. I haven't tested this snippet, but I think this would do what you're suggesting: from wagtail.core import hooks
from wagtail_localize.models import TranslationSource
@hooks.register('after_edit_page')
def after_edit_page(request, page):
source = TranslationSource.objects.get_for_instance(page)
source.update_from_db() or you might consider doing it on |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Algoinde
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It doesn't exist in core or localize out of the box, but you could implement what you're suggesting with a small hook. I haven't tested this snippet, but I think this would do what you're suggesting:
or you might consider doing it on
after_publish_page
.