Skip to content

Bugfix: Update translation state to machine_translated when an outdated translation is machine translated without changes - #4399

Merged
seluianova merged 1 commit into
developfrom
4320-translation-status-is-not-updated-when-source-and-target-translations-are-empty
Aug 31, 2026
Merged

Bugfix: Update translation state to machine_translated when an outdated translation is machine translated without changes#4399
seluianova merged 1 commit into
developfrom
4320-translation-status-is-not-updated-when-source-and-target-translations-are-empty

Conversation

@seluianova

@seluianova seluianova commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Short description

This PR fixes the following issue:

  1. Create two translations, e.g. German and English. The English translation should be either UP_TO_DATE or MACHINE_TRANSLATED.
  2. Change the German translation, making the English translation outdated.
  3. Change the German translation again to restore the same content as in step 1 and enable automatic translation for English.

It was not possible to machine-translate the page to English because of the following error:

Page "Translation test" was not translated into 'English' because there were no changes to the source translation.

Proposed changes

  • Introduce the refreshed_translations flow in the MachineTranslationApiClient class for outdated pages with no changes.
  • When a translation is OUTDATED and has no changes, create a new minor edit version without sending a new request to the MT API to update the translation state.

Side effects

hopefully none

Faithfulness to issue description and design

There are no intended deviations from the issue and design.

How to test

Follow the steps in the bug description.

Resolved issues

Fixes: #4320


Pull Request Review Guidelines

@seluianova
seluianova force-pushed the 4320-translation-status-is-not-updated-when-source-and-target-translations-are-empty branch 5 times, most recently from 603abd0 to 721a665 Compare July 1, 2026 10:47
@seluianova
seluianova force-pushed the 4320-translation-status-is-not-updated-when-source-and-target-translations-are-empty branch from c98ab93 to 0d955d3 Compare August 19, 2026 08:50
@seluianova seluianova changed the title Bugfix: Update translation state to up to date when an outdated translation is published without changes Bugfix: Update translation state to machine_translated when an outdated translation is machine translated without changes Aug 19, 2026
@seluianova
seluianova force-pushed the 4320-translation-status-is-not-updated-when-source-and-target-translations-are-empty branch from 0d955d3 to 464a6b0 Compare August 19, 2026 09:06
@seluianova
seluianova marked this pull request as ready for review August 19, 2026 09:10
@seluianova
seluianova force-pushed the 4320-translation-status-is-not-updated-when-source-and-target-translations-are-empty branch 2 times, most recently from fb97adc to a13a4d9 Compare August 19, 2026 10:10
@MizukiTemma
MizukiTemma self-requested a review August 25, 2026 12:53
@MizukiTemma MizukiTemma self-assigned this Aug 25, 2026

@MizukiTemma MizukiTemma left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good 😸 Nice with a new test added 👍

@hannaseithe
hannaseithe requested review from hannaseithe and removed request for hannaseithe August 26, 2026 09:54

@PeterNerlich PeterNerlich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you! I have two nitpicks, neither of which keep this from being merged as-is, if need be.

Comment thread integreat_cms/core/utils/machine_translation_api_client.py Outdated
Comment thread integreat_cms/core/utils/machine_translation_api_client.py Outdated
Comment thread tests/mt_api/mt_api_test.py
@seluianova
seluianova force-pushed the 4320-translation-status-is-not-updated-when-source-and-target-translations-are-empty branch from a13a4d9 to e6dc491 Compare August 31, 2026 10:43
…lation is machine translated without changes
@seluianova
seluianova force-pushed the 4320-translation-status-is-not-updated-when-source-and-target-translations-are-empty branch from e6dc491 to a174380 Compare August 31, 2026 11:05
@seluianova
seluianova merged commit ed3822e into develop Aug 31, 2026
5 checks passed
@seluianova
seluianova deleted the 4320-translation-status-is-not-updated-when-source-and-target-translations-are-empty branch August 31, 2026 11:13
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.

Translation status is not updated when source and target translations are empty

3 participants