Page MenuHomePhabricator

Invite to translate a section recently edited in another language
Open, HighPublic

Description

Research shows that editors find it easy to make a recent contribution they made into another language they speak. This ticket proposes to surface this kind of opportunity. For example, a user making a contribution to a section in English will get an invite to translate that section to Bengali when visiting the Bengali version (if such section is missing).

expand-edited2 copy 2.png (642×375 px, 77 KB)

  • The cog icon will lead to the settings system where users can opt-out to this kind of invite (to be supported when T290317 is ready. Meanwhile the cog can be skipped)
  • The "Translate <section-name>" option will lead to Section Translation with the article, languages, and section pre-selected.

Details about the logic

This invite will be shown when:

  • The user made, as part of their 10 latest significant edits (more about significant edits below), a contribution to the equivalent page they are visiting (in a different language).
  • The contribution is a significant addition to the section. Diff is +500 bytes or more to consider it "significant".
  • The section where the user contributed in the source language does not exist in the current language.

(The numbers above are suggested as a reference, they are open for discussion and can be tweaked to better capture the intent of the task)

After the initial implementation no events were registered for this entry point (T318910), so it would be good to double-check the instrumentation works as expected

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Pginer-WMF triaged this task as Medium priority.Jul 20 2021, 4:16 PM

Note that this will require a new event_source value in the content_translation_event schema (T287403).

It sounds like a good idea, but I suspect that too many pages will show this notice, given that English Wikipedia articles change too frequently.

The proposed conditions don't sound totally right. I'd think about some other conditions of relevance to the user. For example:

  • If the user created this article in the *current* language or contributed to it significantly. (Not sure how to calculate it, though. Machine learning could be nice, but Wikipedians tend to like precise conditions and not heuristics.)
  • If the page is on the user's watchlist.
  • The user contributed to the article's talk page.

Or maybe I'd think about it in reverse: Maybe it could be an invitation to, say, %1 or anonymous users and check if it gets them to become editors?..

Also, I'd give options such as "Don't suggest me to translate sections for this page" and "Don't suggest me to translate sections for any pages".

It sounds like a good idea, but I suspect that too many pages will show this notice, given that English Wikipedia articles change too frequently.

Thanks for the feedback, @Amire80. Some clarification about when the invite is intended to be shown:

What triggers this invite is the user having edited the source page as part of its 10 most recent edits. It won't be triggered by edits on the source page by any other user. Also, there will be only 10 possible pages at a time where the invite will be shown for a given user. To provide an example, user A edits the Bratislava, Olomuc and Budapest articles in English Wikipedia. User A will see an invite in Bengali Wikipedia when visiting the corresponding Bratislava, Olomuc and Budapest articles if they have missing sections compared to English. User A won't see any notice on the Paris article despite it being constantly edited by other users on English Wikipedia.

If this was not clear in the description, let me know if there is a particular aspect we may need to adjust to make it more clear.

The proposed conditions don't sound totally right. I'd think about some other conditions of relevance to the user. For example:

  • If the user created this article in the *current* language or contributed to it significantly. (Not sure how to calculate it, though. Machine learning could be nice, but Wikipedians tend to like precise conditions and not heuristics.)

Checking for previous participation in the target article makes sense if we want to be more conservative. Given the above, I'm not fully convinced that this can result in a high volume of irrelevant prompts. Having said that, one thing I like about the idea is that makes the prompt even more specific: you contributed to both the source and the target articles, here is an opportunity to expand a missing section.

  • If the page is on the user's watchlist.
  • The user contributed to the article's talk page.

These seem more arbitrary restrictions. Contributing to the source article and visiting the corresponding one in the target language seems a reasonable signal to invite to transfer the previous contribution. Adding additional rules that are not obvious can cause more confusion than helping (i.e., why is the invite not showing this time?). So in case we need to limit the volume I'd be more inclined to limit the number of recent edits we consider (e.g., 5 instead of 10) to keep the logic simple and predictable.

Also, I'd give options such as "Don't suggest me to translate sections for this page" and "Don't suggest me to translate sections for any pages".

Good point. I think it makes sense to have a settings option that lets users disable the system from surfacing translation opportunities. Adding a link from the invites to it would be needed.

Pginer-WMF raised the priority of this task from Medium to High.Sep 6 2021, 9:27 PM

@santhosh in a recent discussion with @Nikerabbit regarding this task, he suggested to create a new CX table, where we can add a new entry each time a significant contribution to a section happens (no more than 10 for each user). This can be implemented in a post edit hook. Then, having all this information in one table we can simply check if that section exists in current article, when user visits the equivalent article in another language. Do you think this approach can work for us?

Change 734870 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CX: Add \"cx_significant_edits\" table to support entrypoint

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

Change 736275 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] SX: Add after edit hook to create entries in significant-edits table

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

@Pginer-WMF inside the invitation banner, under the "Translate <section-name>" option, the text is: "Missing in <language1>, <language2>, and more". However, languages in which the section <section-name> is missing are not available. Could we modify this text to something different? We could use a message like "<section-name> and 3 more are missing", the same way we do for "Contribute again" banner (T260137).

@Pginer-WMF inside the invitation banner, under the "Translate <section-name>" option, the text is: "Missing in <language1>, <language2>, and more". However, languages in which the section <section-name> is missing are not available. Could we modify this text to something different? We could use a message like "<section-name> and 3 more are missing", the same way we do for "Contribute again" banner (T260137).

Thanks for surfacing relevant technical constraints, Nik. If the languages missing are hard to obtain, I think it makes sense to surface sections instead. However, I think we may be cautious with exposing the section names in this context. For example, if the main action says "Translate "list of plants" it does not much sense to either (a) repeat the same section name below ("List of plants and 4 more") or (b) show a different section which could add confusion about which one the usr will be translating ("Zero gravity flowers and 4 more").

Given the above, I think it makes sense to provide the number of missing sections:

Translate "List of plants"
5 sections missing in Bengali

This provides useful overview of the possibilities of expanding the article further, while keeping clear which is the section selected.

Please let me know if the new proposal makes sense and it is more feasible to support.

Change 738178 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] SX recent edit entrypoint: add hook to register JS module

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

Change 738192 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] SX: Add UI for entrypoint for translating recently edited section

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

Change 740887 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CX entrypoints: Add model and store for recent significant edits

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

For this entry point, has the instrumentation part be considered as part of the current work or is it preferred to create a separate ticket (to implement or discuss details about it)?

ngkountas changed the task status from Open to In Progress.Feb 1 2022, 12:07 AM

Change 763179 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CX recent edit entrypoint: Add EditedSectionFinder service

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

Change 734870 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX: Add \"cx_significant_edits\" table to support entrypoint

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

Change 740887 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX recent edit entrypoint: Add edit model and store

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

Change 763179 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX recent edit entrypoint: Add EditedSectionFinder service

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

Screenshot from latest patch:

DesktopMobile
image.png (962×746 px, 291 KB)
image.png (962×746 px, 228 KB)

Issues noticed:

  1. Should we show this invite in desktop? I dont think so.
  2. Alignment issue for the + icon. Looks ok in Mobile though
  3. The link target takes to wrong URL(URL has missing title=Special:ContentTranslation part).
  4. The Translate button could be a link for accessibility reasons.
  5. Dismiss button hides it, but should we hide the message permanently? Remember it atleast in browser session?

I updated the related patch to fix above issues. @Pginer-WMF could you confirm we should not show this invite in desktop as Santhosh mentions in the first (1) issue above? Also, do you think we should add some additional logic to hide the invitation permanently when the close button is clicked (as asked in issue (5) above)?

Regarding the questions:

(1) I think we should not show the invite on desktop for now. Translating sections on desktop is not fully supported. Once desktop support for sections is more stable, we can consider exposing this. I'll create a separate ticket for this.

(5) Disabling "permanently" can have multiple interpretations:

  • Different articles. It is ok for the invite even if the user discarded it in a different article previously. A general way to opt-out for this kind of contribution invite (and others) will be provided through a cog icon when T290317 is ready.
  • Same article. Ideally, it would be great not to make the same exact suggestion for the same edited section on the same article once users have discarded it. That is, if I discard a suggestion to translate the "Legal status" of the Moon article:
    • It will not be expected to be shown just by refreshing or visiting the same page without any other edit activity.
    • It may be expected to be shown if the source article was edited again by me for the same or other section. In this case the invite would be understood as a suggestion to transfer the new contents. This is less important consideration than the previous one, so we can be flexible depending on technical complexity.

Change 736275 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX: Add after edit hook to create entries in significant-edits table

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

Change 738178 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX recent edit entrypoint: add hook to register JS module

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

Change 738192 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX: Add UI for entrypoint for translating recently edited section

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

Nikerabbit changed the task status from In Progress to Open.Sep 6 2023, 7:41 AM