Notify the user when there are new messages to translate
Open, NormalPublic

Description

It would be desirable to be able to add a message group to your watchlist (for a given language).

This would allow translators to add e.g. a fundraising banner to their watchlist in order to quickly get a notification if any new/extra translation is needed.

The current mechanism only allows a user to add each individual source message meaning messages added to the group would not trigger a notification.

Watchlist should be triggered either by changes in the message group state for the selected language. I.e. by anything changing the percentage of translated/outdated messages.

Details

Reference
bz60904
bzimport raised the priority of this task from to High.
bzimport set Reference to bz60904.
bzimport added a subscriber: Unknown Object (MLST).

Amir, I see you are changing priorities. Does this mean that as a product manager, you're going to put resources to fixing this issue? If so, can you please indicate where I can see how this issue is being treated on your backlog?

Nikerabbit lowered the priority of this task from High to Normal.Jan 26 2015, 9:22 PM
Tbayer added a subscriber: Tbayer.May 26 2015, 8:42 PM
Nikerabbit updated the task description. (Show Details)Apr 20 2016, 12:05 PM
Nikerabbit removed a subscriber: wikibugs-l-list.
Nikerabbit renamed this task from Adding message group to watchlist to Notify the user when there are new messages to translate.Apr 25 2017, 8:42 AM
Amire80 assigned this task to Anna.d92.May 14 2017, 9:58 AM
Amire80 added subscribers: Anna.d92, Roni.zhelenchuk.

I am working with @Anna.d92 and @Roni.zhelenchuk to resolve this, as part of their project in the Hebrew University.

I met @Anna.d92 and @Roni.zhelenchuk and we discussed some ideas about implementation and timeline. Here's the summary. Feedback is welcome, especially from @Nikerabbit.

  • Backend
    • How will the watched projects / message groups be stored?
      • One solution: Add a new db table similar to the watchlist table in core. The fields will be:
        • twl_id
        • twl_user
        • twl_message_group
        • twl_notificationtimestamp
      • Another solution:
        • Something in the user preferences?..
    • Will this be different between message groups for software projects and translatable pages?
      • A translatable page is just a wiki page and can (probably) be watched with the usual watchlist.
      • Perhaps an aggregate group of translated pages can be watched as a project?
    • When is the notification sent?
      • Initiated by the updating script?
      • (Probably better:) Identified by MediaWiki / Translate, without dependency on translatewiki scripts
      • (This should probably be as close as possible to how it works with the core page watchlists.)
    • How is it sent:
      • Notifications extension? (a.k.a. Echo)
        • Probably preferable
        • It will be useful to make it possible to connect this not only to email and notification indicators in the personal bar, but also propagate it to bots on Telegram, IRC, etc.
      • A separate notification or email system? (Probably less good)
  • Frontend:
    • How do we add a project to the watchlist and remove it?
      • A star near the project selector, similar to the watchlist star?
        • Near the breadcrumbs at the top?
        • Or near each message group row in the project selector?
      • Should we make editing the “raw” watchlist possible, like in the core MediaWiki? (probably low priority)
  • Project plan:
    • Preparation:
      • Make sure MediaWiki core and Translate extensions are installed and up to date
      • Have Gerrit accounts
    • Development:
      • Create a variable that enables the project watchlist feature (e.g. wgTranslateProjectWatchlist). Should be disabled by default, at least in the beginning, to allow development and testing.
      • Add the new database table creation script to Translate/sql, and make sure that it runs in update.php
      • Create an API to add to the watchlist and remove from the watchlist
        • A lot can probably be copied from <core>/includes/api/ApiWatch.php
      • Test at Special:ApiSandbox
      • Add the watchlist star (or whatever other design solution…)
      • Implement notification
        • (See above: Triggered form the script? Or triggered by a job inside MediaWiki/Translate while updating the message groups)
      • Add editing watchlist / raw watchlist
        • Learn from <core>/includes/specials/SpecialEditWatchlist.php
    • Deployment:
      • (at some point in the near future, when the basics are done): Deploy to dev.translatewiki.net
      • (at some later point after testing at dev): Deploy to the real translatewiki.net
      • (at some later point): Deploy to meta, mediawiki.org, etc.

The database table needs a primary key, is that twl_id with autoincrement?

Create an API

These days you must specify whether this is PHP class/interface, action API or rest API :)

When is the notification sent?

One can hook into MessageIndex::rebuild – in fact there is even a hook TranslateEventMessageMembershipChange. I suggest to review carefully that part of code to make sure it is correct and does what is wanted – preferably by adding some unit tests. When using it I would recommend to code defensively add some sanity checks to avoid sending a flood of notifications, for example if we lose the cache and have to rebuild from scratch and treat everything as new.

How is it sent

Echo is the best option here. I see no reason to re-invent that wheel.

Change 429656 had a related patch set uploaded (by Anna.d92; owner: Anna.d92):
[mediawiki/extensions/Translate@master] WIP Add API for message group watchlist

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

Elitre rescinded a token.May 2 2018, 9:24 AM
Elitre awarded a token.

Change 433716 had a related patch set uploaded (by Anna.d92; owner: Anna.d92):
[mediawiki/extensions/Translate@master] Added a watch/unwatch option to the Special:Translate

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

Change 433935 had a related patch set uploaded (by Nikerabbit; owner: Anna.d92):
[mediawiki/extensions/Translate@master] Add star icon to message group watching

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

Change 434042 had a related patch set uploaded (by Anna.d92; owner: Anna.d92):
[mediawiki/extensions/Translate@master] Added a watch/unwatch option to the Special:Translate

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

Change 433716 abandoned by Anna.d92:
Added a watch/unwatch option to the Special:Translate

Reason:
Done in https://gerrit.wikimedia.org/r/#/c/434042/

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

Change 429656 abandoned by Anna.d92:
WIP Add API for message group watchlist

Reason:
Done in https://gerrit.wikimedia.org/r/#/c/434042/

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

Change 433935 abandoned by Anna.d92:
Add star icon to message group watching

Reason:
Done in https://gerrit.wikimedia.org/r/#/c/434042/

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

Change 434100 had a related patch set uploaded (by Anna.d92; owner: Anna.d92):
[mediawiki/extensions/Translate@master] Added API query to get message group watchlist information.

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

Change 434113 had a related patch set uploaded (by Amire80; owner: Anna.d92):
[mediawiki/extensions/Translate@master] Added a watch/unwatch option to the Special:Translate

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