Bugfix: Show UP_TO_DATE translation status when a translation is manually updated without changes - #4411
Conversation
hannaseithe
left a comment
There was a problem hiding this comment.
This change looks good to me.
I would suggest to add some tests though, both for the translation_state logic and for the minor_edit flag - just to reduce the regression risk around this rather complex business logic. At the minimum I would suggest a test that checks for the "veraltete machine translated status -> no content update -> UP_TO_DATE state"
I agree, I added exactly this test in my another PR: #4399 UPD. okay it is not exactly the same, but I would prefer to continue with tests in 4399 anyway, because I also did some test refactoring there to simplify test creation. Would this be fine for you? @hannaseithe |
e7c859c to
f80a2ca
Compare
…ated without changes
f80a2ca to
e99ad62
Compare
Short description
For some historical reasons, when a user saved a translation without content changes, we saved it as a major edit.
Only if there were any other changes on the form, except for the title or content fields, did we save it as a minor edit.
After this change was introduced, we started saving translations without content changes as minor edits.
This introduced the following side effect:
When a user manually updated a machine-translated page without any content changes, it did not change the status from "machine translated" to "up-to-date" (check mark).
Because we defined translation state based on the last major version.
Proposed changes
translation_stateproperty: use the last public or draft version to determine the translation state (Previous behavior: the last major version was used)Side effects
I could not find any, but careful testing is needed.
Faithfulness to issue description and design
There are no intended deviations from the issue and design.
How to test
Existing translation outdated after machine translation of unchanged source translation #4254
After saving a published page as a draft all the existing translations become "outdated" (from draft to publish happens the same) #4284
Resolved issues
Fixes: #4397
Pull Request Review Guidelines