WordPress.org

Making WordPress.org

Opened 16 months ago

Closed 3 days ago

#2000 closed task (fixed)

Infrastructure for Cross-Locale PTEs

Reported by: akirk Owned by:
Milestone: Priority: high
Component: Translate Site & Plugins Keywords:
Cc:

Description

As discussed on September 7th in Slack, there are some changes necessary to allow cross-locale PTEs on translate.wordpress.org (see Cross-Locale PTE Trial for more background).

It was agreed that

  • Specific user accounts (cross-locale PTEs) are able to import and approve translations for specific projects for all locales.
  • A cross-locale PTE can import (or translate through UI) untranslated strings as current.
  • A cross-locale PTE can import (or translate through UI) translated (by the community) strings as waiting.
  • Translations by a cross-locale PTE can be overwritten by a regular PTE or a GTE.

This will need:

  • An interface (admin.php?page=add-cross-locale-pte) to assign the GlotPress permission which needs:
    • an input field for username/email
    • The project list/table as it already exists in the PTE assigning interface
    • A submit button
  • Filters in GlotPress to allow this (PR on GlotPress-WP to follow).
  • Code in wporg-gp-rosetta-roles to enforce the permissions listed above.

Attachments (16)

cross-locale-pte-admin-overview.png (88.6 KB) - added by akirk 13 months ago.
cross-locale-pte-admin-edit-user.png (129.7 KB) - added by akirk 13 months ago.
2000.diff (23.6 KB) - added by akirk 13 months ago.
2000.2.diff (23.8 KB) - added by akirk 13 months ago.
2000.3.diff (24.1 KB) - added by ocean90 12 months ago.
2000.png (165.1 KB) - added by ocean90 12 months ago.
2000.4.diff (24.2 KB) - added by akirk 12 months ago.
cross-locale-pte-no-checkboxes-for-other-current.png (66.7 KB) - added by akirk 9 months ago.
No checkboxes for current translations by others
cross-locale-pte-my-new-translation-is-current.png (72.6 KB) - added by akirk 9 months ago.
My new translation is current
cross-locale-pte-fuzzy-translations-can-be-made-current.png (72.2 KB) - added by akirk 9 months ago.
I can make fuzzy translations current
cross-locale-pte-cannot-change-translations-that-i-have-approved.png (114.4 KB) - added by akirk 9 months ago.
I cannot modify translations by others that I have approved
cross-locale-pte-cannot-overwrite-existing-translation.png (125.4 KB) - added by akirk 9 months ago.
When I submit a translations where a current owned by someone else exists, my new translation is waiting, not current
2000.5.diff (1.8 KB) - added by akirk 9 months ago.
2000.6.diff (1.8 KB) - added by akirk 9 months ago.
cross-locale-pte-can-reject-approved-translations.png (96.0 KB) - added by akirk 9 months ago.
With the newest patch I can now reject a translation that I approved. I still cannot override translation approved by someone else which is by design.
Screen Shot 2017-03-14 at 10.43.57.png (87.9 KB) - added by akirk 9 months ago.
Double waiting entries

Download all attachments as: .zip

Change History (34)

#1 @ocean90
16 months ago

  • Priority changed from normal to high

#2 @ocean90
16 months ago

#1765 was marked as a duplicate.

#3 @akirk
15 months ago

The GlotPress side of this is tracked in https://github.com/GlotPress/GlotPress-WP/issues/537 which already has a pull request along with a sample implementation of a WordPress-GlotPress plugin (to be converted into a Rosetta plugin).

This ticket was mentioned in Slack in #polyglots by ocean90. View the logs.


15 months ago

@akirk
13 months ago

@akirk
13 months ago

#5 @akirk
13 months ago

I have now added a first version of both admin interface and GlotPress plugin. The patch also extends the current GlotPress hook which is used in translate.wordpress.org. Happy to hear any reviewing thoughts!

@ocean90
12 months ago

@ocean90
12 months ago

#6 @ocean90
12 months ago

@akirk I couldn't get 2000.2.diff working.

2000.3.diff includes a few fixes:

  • Adds a require_once for the Cross_Locale_PTE class (global.w.org mu-plugins are not loaded for translate.w.org)
  • Fixes first argument of Cross_Locale_PTE::user_has_cross_locale_permission(), it's a user object, not only a user ID
  • Adds the date_added field in Cross_Locale_PTE::update_cross_locale_pte()
  • Fixes the user property in Cross_Locale_PTE::get_all_users() for the email, email => user_email

It looks like the current code doesn't handle our project hierarchy. For example I added the user to plugin X, but the translations are actually in a sub-project (dev/stable/dev-readme/stable-readme) of X. See #2255 for some background around this.

#7 @ocean90
12 months ago

In 4510:

Translate, Rosetta Roles: Add support for the new translation object type.

See https://github.com/GlotPress/GlotPress-WP/pull/538.
See #2000.

@akirk
12 months ago

#8 @akirk
12 months ago

@ocean90 Thanks for your fixes! I have uploaded a new version of the patch which should fix the project hierarchy problems (simply by querying against parent_project_id, similar to [4427]). Again I had a trouble running the patch on my local meta-environment, so I hope that I didn't mangle your environment specific fixes in the diff.

#9 @ocean90
10 months ago

In 4929:

Translate/Rosetta: Add infrastructure for Cross-Locale PTEs.

Props akirk.
See #2000.

#10 @ocean90
10 months ago

@akirk I added you as a Cross-Locale PTE to https://translate.wordpress.org/projects/wp-plugins/nothing-much so you can do some further testing.

#11 @akirk
10 months ago

Great, thank you very much! I'll proceed with testing and will ping you back when I have a verdict.

@akirk
9 months ago

No checkboxes for current translations by others

@akirk
9 months ago

My new translation is current

@akirk
9 months ago

I can make fuzzy translations current

@akirk
9 months ago

I cannot modify translations by others that I have approved

@akirk
9 months ago

When I submit a translations where a current owned by someone else exists, my new translation is waiting, not current

#12 @akirk
9 months ago

I've added a bunch of screenshots from my test. The only thing that I think doesn't work as expected is that I lose the right to modify/override a translation when I have approved it. For example if I approve a translation by accident there is no way to recover except to ask a PTE/GTE.

I'd therefore suggest to change the code so that you can also modify translations for which you are the one who validated them (i.e. user_id_last_modified trumps user_id). I have modified added a new diff for that change.

@akirk
9 months ago

@akirk
9 months ago

#13 @ocean90
9 months ago

In 5132:

Translate/Rosetta: Allow Cross-Locale PTEs to reject translations which they have approved.

Props akirk.
See #2000.

@akirk
9 months ago

With the newest patch I can now reject a translation that I approved. I still cannot override translation approved by someone else which is by design.

#14 @akirk
9 months ago

@ocean90 Thanks! The fix worked, see the screenshot :)

#15 @ocean90
9 months ago

@akirk Great! I only had to add the if ( $current_translation ) {} check. What else is missing here?

@akirk
9 months ago

Double waiting entries

#16 @akirk
9 months ago

@ocean90 thanks for catching that.

I've now completed the test with importing PO files and it successful, all of the above UI operations were reflected in the outcome.

The only thing that stood out for me was that I was able to import duplicate waiting translations: when importing as current for a current translation by someone else, the entry was correctly downgraded to waiting. Upon second import, the same happend but the duplicate waiting translation should have been dropped. I am not sure what actually caused this because the GlotPress core code should prevent that.

This ticket was mentioned in Slack in #meta-i18n by sergey. View the logs.


3 months ago

#18 @ocean90
3 days ago

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.