Skip to content

UpdateTranslationsView: sync draft content if available#884

Open
th3hamm0r wants to merge 1 commit intowagtail:mainfrom
th3hamm0r:feature/823-sync-draft-changes
Open

UpdateTranslationsView: sync draft content if available#884
th3hamm0r wants to merge 1 commit intowagtail:mainfrom
th3hamm0r:feature/823-sync-draft-changes

Conversation

@th3hamm0r
Copy link
Copy Markdown
Contributor

As noted in #823 (comment) the draft content is not synced, when the "Sync translated pages" action is used.
This allows to change/prepare the content of a source object, without publishing it (yet), and further sync those changes to the translations to prepare those changes to be published later all at once.

I've deviated slightly from my suggestion to introduce a new setting. Instead, the sync only uses the draft content if the "Publish immediately" checkbox is not checked.

What do you think about it? Better use a setting and disable that functionality by default?

Fixes #823

If the sync is executed with the publish_translations-checkbox
unchecked, the latest revision's content is synced to the translations.

Fixes wagtail#823
@th3hamm0r th3hamm0r force-pushed the feature/823-sync-draft-changes branch from 5fbf7f1 to 84a167c Compare January 8, 2026 07:17
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.07%. Comparing base (ceaf5ee) to head (84a167c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #884   +/-   ##
=======================================
  Coverage   93.07%   93.07%           
=======================================
  Files          47       47           
  Lines        4243     4245    +2     
  Branches      551      552    +1     
=======================================
+ Hits         3949     3951    +2     
  Misses        175      175           
  Partials      119      119           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lourduradjou
Copy link
Copy Markdown

lourduradjou commented Mar 22, 2026

I reviewed this code and It solves the issue #823, Attaching a video that showcases this.

wagtail.draft.sync.issue.resolved.demo.mp4

My review on what is happening now:

Two cases:

Case 1: (Existing code without this PR changes applied)

  • If I create a new page , draft save it, apply translate this page. I can see the translate view page.
  • Here I can do some changes in the source page(assume english) and sync translate again that will reflect in the translated page (say french) so it works fine in this case.

Case 2: (Existing code without this PR changes applied)

  • After the case one, I published the site.
  • Now If I make changes and save draft it, apply sync translate. This time it won't work as now onwards it requires the changes to be published so that the sync translate would work. (This is the issue which performs opposite the case 1)

After applying author's PR changes locally in the code it handles both CASE 1 and CASE 2 (Tested by me locally). So the issue was addressed but It could be enhanced a little.

Suggestions as a User:

What I felt was each time I have to publish/save draft and then click the three dots to open the pop up to translate the page. This is very redundant in nature. Instead we can have a button say Publish and sync in the bottom view itself or Save draft and sync or Publish and draft sync. This approach would reduce the frequent need of opening the three dots.

image

(Here we can add new buttons , maybe something which when hovered opens into more buttons "compactness :)" )

@zerolab if you prefer some changes in this PR or my suggestions I am more than happy to work in it and add @th3hamm0r as co-author to solve this issue.

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.

Wagtail-localize only syncs to the translated pages, sometimes.

3 participants