Page MenuHomePhabricator

Explicitly reverting an edit to a translation unit should revert changes to the fuzzy status
Closed, ResolvedPublic2 Estimated Story PointsFeature

Description

Context:

! In T49177#9834118, @Tacsipacsi wrote:
Good point. You could skip unfuzzying if $editResult->getRevertMethod() === EditResult::REVERT_UNDO || $editResult->getRevertMethod() === REVERT_ROLLBACK. (You shouldn’t use $editResult->isRevert() because manual reverts are often changes that do need to unfuzzy.)

I was thinking "a revert, by any means, of an edit by someone who doesn't have the unfuzzy permission doesn't unfuzzy" -> there have been several occasions in which I thought about about using the undo bit to unfuzzy a unit (most recently when cleaning up this mess - I decided to do manual reverts there instead because the people who I was reverting didn't need to get revert notifications)

This should be split to a separate task, though.

An alternate suggestion I came up with: if an edit is reverted explicitly (via undo, rollback, or some other tool, or maybe even manual reverts), the new version has the fuzzy status copied from the old version. This means that is an outdated translation unit is vandalized, and the vandalism is reverted by some translation-unaware tool then the outdated status would be preserved.

Conceptually the opposite of T367932 (handling fuzzy status correctly when the source text is reverted)

Event Timeline

This comment was removed by Pppery.

Sorry wrong task

Change #1088925 had a related patch set uploaded (by Pppery; author: Pppery):

[mediawiki/extensions/Translate@master] Set fuzzy status to status of prior revision on undo or rollback

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

The patch related to this task has been reviewed but since this change might have unforeseen side-effects, we want to avoid deploying it before the holidays. Will merge the patch in, in early Jan, 2025.

Nikerabbit changed the task status from Open to Stalled.Dec 12 2024, 12:42 PM
abi_ changed the task status from Stalled to In Progress.Jan 7 2025, 1:45 PM

Change #1088925 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Update fuzzy and transver tag properly on undo or rollback

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

@Pppery Can you confirm whether the issue has been fixed?

(Sorry for the delay, I somehow missed that ping)

Test case on Wikimedia Commons, a wiki that hasn't restricted unfuzzy:

An IP unfuzzies a translation unit: https://commons.wikimedia.org/w/index.php?title=Translations:Commons:Wiki_Loves_Folklore_2025/79/uz&diff=prev&oldid=994572145

I make a dummy edit to make MediaWiki happy: https://commons.wikimedia.org/w/index.php?title=Translations:Commons:Wiki_Loves_Folklore_2025/79/uz&diff=next&oldid=994572145

I use "undo" to undo both our edits: https://commons.wikimedia.org/w/index.php?title=Translations:Commons:Wiki_Loves_Folklore_2025/79/uz&diff=next&oldid=995681473

The manifestation of my edit restores the FUZZY tag: https://commons.wikimedia.org/w/index.php?title=Commons:Wiki_Loves_Folklore_2025/uz&diff=prev&oldid=995681599

And you can also see in the translation UI that it also restored the transver.

That confirms the patch has at least minimally made it to production. I could repeat the other automated test cases on some production wiki but I don't see what that would accomplish. I spent a long time looking for vandalism to a fuzzy tunit in production to revert or see others reverted, but either it didn't happen or my search-fu wasn't good enough.

Thanks. I think that is good enough.