WordPress.org

Making WordPress.org

Opened 11 months ago

Closed 11 months ago

Last modified 11 months ago

#5576 closed enhancement (fixed)

Automatically reject previous pending translation from same user

Reported by: tobifjellner Owned by: dd32
Milestone: Priority: normal
Component: Translate Site & Plugins Keywords:
Cc:

Description

This problem is described in https://github.com/GlotPress/GlotPress-WP/issues/889 and in a perfect world, this should probably be fixed in GlotPress.

But I just learnt that this probably can be solved relatively easy by adding a filter via an add-on to GlotPress in our own systems. So I suggest that this should be developed for translate.wordpress.org and then it can be submitted upstream for possible later inclusion.

Currently, if a user has suggested a translation and then notices a typo or other error (possibly even getting a warning from GlotPress about missing variables, etc.) and then submits another suggestion, these both suggestions will both become pending in the project. (Technically, the user can go back and manually reject their own pending translation, but in reality that simply doesn't happen.)

When a translation editor afterwards checks the pending translations, there's a risk that the wrong string will be approved after the correct one, leaving the wrong translation as the active translation. Also, if I as a translation editor scan a full page of translations, my view will by itself get stuck on various error, and only later I'll realize that the user already submitted a different translation for the same string.

The solution: When a not-editor submits a translation into pending, if there are any previous pending translation(s) of the same string from the same user, then those previous strings should automatically be rejected.

Attachments (1)

Screen Shot 2021-01-14 at 1.22.38 pm.png (41.5 KB) - added by dd32 11 months ago.
Example of a translation that's auto-rejected. Note that there's no "Rejected By" byline, as it was "self rejected"

Download all attachments as: .zip

Change History (9)

This ticket was mentioned in Slack in #meta by tobifjellner. View the logs.


11 months ago

#2 @dd32
11 months ago

  • Owner set to dd32
  • Status changed from new to accepted

Just noting that r10575 was slightly half-related:

Translate: Prevent suggesting a string which has already been rejected for that original for that user.

This prevents a translator suggesting the same sting for an original after having their translation rejected once.

See https://wordpress.slack.com/archives/C02RP50LK/p1610520419455100

Specifically for this ticket however, what should be the status of the suggested-but-replaced strings from the translator? should they be rejected by the translator? or is there another status I'm not aware of?

#3 follow-up: @tobifjellner
11 months ago

I'd put it as "rejected" by same user...
When they file a new suggestion, that's their intention, after all!

If it wouldn't be too big a resource hog, we might even consider a one-shot hunting for double suggestions and rejecting in the same way the older suggestions in the database.

#4 in reply to: ↑ 3 @dd32
11 months ago

Replying to tobifjellner:

I'd put it as "rejected" by same user...
When they file a new suggestion, that's their intention, after all!

Sounds good to me!

If it wouldn't be too big a resource hog, we might even consider a one-shot hunting for double suggestions and rejecting in the same way the older suggestions in the database.

The translations table is quite massive (There's only 75 million translations or so), so I'm a little limited there but I'll see what I can do. That'll also depend upon just how many originals have multiple pending translations though :)

#5 follow-up: @tobifjellner
11 months ago

...There's only 75 million translations or so...

The good thing is that it can be broken down into one project at a time. Perhaps cron-running one locale at a time.

#6 in reply to: ↑ 5 @dd32
11 months ago

Replying to tobifjellner:

...There's only 75 million translations or so...

The good thing is that it can be broken down [...]

There's only ~64k users with more than 1 translation suggestion (and I can look up all of a users translations efficiently), so it looks like it'll possible to go through and automatically mark the translations 🎉

#7 @dd32
11 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 10576:

Translate: When a translator re-submits a translation suggestion, automatically reject their previous submitted translations for that original.

This will mean that those who see a Translation warning, fix it, and then re-submit will only have 1 waiting translation rather than 2.

Fixes #5576.

@dd32
11 months ago

Example of a translation that's auto-rejected. Note that there's no "Rejected By" byline, as it was "self rejected"

#8 @dd32
11 months ago

In 10587:

Translate: Avoid PHP Notices after r10575 and r10576 when the translation is being added without a translator detail.

See #5576.

Note: See TracTickets for help on using tickets.