Skip to content

Conversation

th3hamm0r
Copy link
Contributor

@th3hamm0r th3hamm0r commented Oct 21, 2025

This only partially implements the proposed changes of #789 (comment) and should be seen as an early draft now open for discussion.

TBD:

  • Publication + automatic machine translation: the attribute on the request looks a bit ugly, but it was the easiest and in my view the lightest approach (in contrast to sub-classing the EditView for Page).
  • I've left out snippets for now, but I could mostly mirror the page logic, but listen for the wagtail.signals.published signal instead of the after_publish_page hook (actually this signal could be used for pages too 🤔 )
  • I've skipped bulk sync for now, as it requires quite a lot of extra code and UI
  • The go_live_at date isn't synced at the moment (which is understandable, as there are other use cases too), so I had to skip the publish+machine-translation for future dates. I've ignored this in the auto-sync on publish action, as it looked sensible to me to get the new content into the translations when a publication is planned.

Todo:

  • Tests
  • Docs

Relates to #789

This can be enabled by setting
WAGTAILLOCALIZE_UPDATE_TRANSLATIONS_ON_PUBLISH = True

Relates to wagtail#789
publish_translations=form.cleaned_data["publish_translations"],
)

self.components.save(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With publish+auto-machine-translate we cannot really handle those components, I think. With bulk actions we may add those components to the confirmation view. That's why I have not extracted them into update_translations().

I also don't fully understand them. Are those components meant to be created once per translation request or once per translation source? I know, it's up to the dev, but it would be nice to get some infos on how this has been used so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant