Page MenuHomePhabricator

Automatically mark translations of a message outdated when source text changes in a message bundle
Closed, ResolvedPublic4 Estimated Story PointsFeature

Description

The main job of the Translate extension is to track which translations are up to date and surface translations that need updating to translators.

This feature is not yet implemented for message bundles. Unlike for page translation, there isn't a separate review step by translation admins. Any change to source text will mark all existing translations of that message as outdated.

Rough implementation plan:

  • Listen to edit-complete events from MediaWiki core using a hook
  • On such event, compare the new contents to the previous version to determine the keys with changed content
    • Note: Keys may be deleted and then used again, and this should work as well. Fail proof option is to mark all new keys as outdated (usually they don't have translations).
      • Note: If we create /en pages for message definitions (which we should do anyway for tp:transver tag to work, for displaying diffs of what has changed), we can just query those values and compare
  • Span MessageUpdateJobs with appropriate flags to update outdated status

Event Timeline

Change 831199 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] MessageBundle: Replace space with underscore when building definition

https://gerrit.wikimedia.org/r/831199

abi_ changed the task status from Open to In Progress.EditedSep 11 2022, 7:42 AM
abi_ claimed this task.
abi_ subscribed.

There is some code already that marks the translations as fuzzy when the source changes. The UpdateMessageBundleJob already compares the previous content, and the current content and pass the appropriate values to the MessageUpdateJob class.

This was not appearing on the front end due to issues with translation aids for which I will submit a patch.

Note: Keys may be deleted and then used again, and this should work as well. Fail proof option is to mark all new keys as outdated (usually they don't have translations).

This part is not done and we will have to implement.

Change 831226 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] MessageBundle: Mark new keys as fuzzy

https://gerrit.wikimedia.org/r/831226

Change 831199 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] MessageBundle: Replace space with underscore when building definition

https://gerrit.wikimedia.org/r/831199

Change 831226 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] MessageBundle: Mark new keys as fuzzy

https://gerrit.wikimedia.org/r/831226

Special:PageTranslation has a checkbox to allow translation units not to be fuzzied, and this is for a reason. Letting translators retranslate messages when e.g. a typo has been corrected in the original message is a waste of human resources. If it’s not the translation admins’ task, probably the users doing the edits to the original messages should indicate whether the message needs to be fuzzied.

Special:PageTranslation has a checkbox to allow translation units not to be fuzzied, and this is for a reason. Letting translators retranslate messages when e.g. a typo has been corrected in the original message is a waste of human resources. If it’s not the translation admins’ task, probably the users doing the edits to the original messages should indicate whether the message needs to be fuzzied.

Thanks for the feedback. We've created T317736: Provide option to not fuzzy translations for message bundle when source string changes to add this feature in the future.

This was deployed and tested on translatewiki.net. No issues were noticed but waiting for Niklas to do some QA from his side before marking this as done.