Page MenuHomePhabricator

Create new API to support publishing a translated section
Closed, ResolvedPublic

Description

In order to support the publish step (T252542) of the Section Translation workflow, the backend functionality is needed to support adding the contents of the translated section tot he target article.

The Content Translation Publish API will be extended to support:

  • Adding the translated contents as a new section at the end of the target article.
    • This should be in sync with the "compare the contents" step where a placeholder is shown indicating where the contents will be published.
  • Mark the edit with the following edit tags: "contenttranslation", "sectiontranslation" and "mobile edit"
  • The edit summary will include a reference to the original translation: "Created by translating the section "X" from page "Y". Where X is the section title in the source language and Y is the article name linking to the revision used for the translation.

Event Timeline

  • Mark the edit with the following edit tags: "sectiontranslation" and "mobile edit"
    • The resulting edit will not include the "contenttranslation" tag.

I actually think that we should tag these edits with contenttranslation. Section Translation is a component of the broader Content Translation feature, and when a data user asks the question "how many edits have been made using Content Translation", I think the answer should include both whole-article and section translation by default.

If we do this, we will still be able to distinguish whole-article translation by looking for edits tagged as contenttranslation but not sectiontranslation. We could also look for edits tagged as contenttranslation that create a new page; this would also work very well, but miss the edge case of new whole-article translations which overwrite existing articles.

I actually think that we should tag these edits with contenttranslation. Section Translation is a component of the broader Content Translation feature, and when a data user asks the question "how many edits have been made using Content Translation", I think the answer should include both whole-article and section translation by default.

Ok. This is the part I was going back and forth a bit. If it is preferred to have the "contenttranslation" tag too from the data perspective, I'll update the spec to reflect this.

I was thinking on how to filter for each case with generic tools such as turnilo. I guess that we can easily filter for the contributions we currently identify with Content translation by either using the "creates new page" and/or the "platform"filters.

I was thinking on how to filter for each case with generic tools such as turnilo. I guess that we can easily filter for the contributions we currently identify with Content translation by either using the "creates new page" and/or the "platform"filters.

Mmm, good point. I had been thinking about data clarity, but not about how it would affect Turnilo.

What I've proposed is analogous to the mobile edit and mobile web edit tags. Mobile edit is applied to all mobile edits, app or web, while `mobile web edit

Sorry, I submitted that comment before I was done.

It's a good point that this will make things harder in Turnilo. That's because it doesn't allow you to specific two different filters using the same field (like revision_tags contains contenttranslation and revision_tags does not contain sectiontranslation).

However, this is a limitation specific to Turnilo; Superset, for example, is happy to let you do it (for example, this is a Turnilo-like Superset query with a double filter on revision_tags).

So, given that even in Turnilo we have a good workaround, I'd prefer not to let Turnilo's limitations push us into creating confusing data (not tagging section translation edits as contenttranslation even though they're defintely produced using the Content Translation feature).

santhosh renamed this task from Extend publish API to support publishing a translated section to Create new API to support publishing a translated section.Oct 7 2020, 9:59 AM

Change 632660 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/extensions/ContentTranslation@master] Add API for publishing section translations

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

Change 632660 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Add API for publishing section translations

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

I will keep this in in-progress till we do end-to-end tesitng this api

@ngkountas I tried to publish an example from the testing server. I got the feedback but I was not redirected to the result page. Is there a way to see the published result or is that not possible on the test server?

@ngkountas I tried to publish an example from the testing server. I got the feedback but I was not redirected to the result page. Is there a way to see the published result or is that not possible on the test server?

I checked the contributions page and the contents were published.