Port Translate to new RC Filters system
Closed, ResolvedPublic

Description

See for example "Filter translations" at https://meta.wikimedia.org/wiki/Special:RecentChanges .

I think this can be converted to STRING_OPTIONS, maybe with an imply (setAsSuperSetOf).

Is this something you are planning to do, or are you seeking for someone else to work on this? If former, please keep the BC requirements in mind (last two stable releases). If the latter, could you provide more information about the new system?

Is this something you are planning to do, or are you seeking for someone else to work on this? If former, please keep the BC requirements in mind (last two stable releases). If the latter, could you provide more information about the new system?

Either. It is not a breaking change, though, so it's not urgent and can wait until it's been in two stable releases. It will be available on doc.wikimedia.org (and maybe we will add more docs on MediaWiki.org) after merge.

@jmatazzoni I checked the pages you linked, but it seems they are all user documentation. I was actually looking for developer documentation such as how to enable this feature, what hooks, configuration variables or APIs I need to use to hook into this feature. I guess those are coming soon as per what @Mattflaschen-WMF said above.

I guess those are coming soon as per what @Mattflaschen-WMF said above.

The main hook is ChangesListSpecialPageStructuredFilters.

There are links there for general information. I think in this case, the developer will want to construct a ChangesListStringOptionsFilterGroup object and the associated ChangesListStringOptionsFilter objects.

The group is registered with $special->registerFilterGroup. The detailed documentation is in the methods of each class.

@jmatazzoni I checked the pages you linked, but it seems they are all user documentation. I was actually looking for developer documentation such as how to enable this feature, what hooks, configuration variables or APIs I need to use to hook into this feature. I guess those are coming soon as per what @Mattflaschen-WMF said above.

This documentation is complete. See https://www.mediawiki.org/wiki/Edit_Review_Improvements/New_filters_for_edit_review/How_to_implement_a_filter , as well as the Doxygen API documentation.

Stryn added a subscriber: Stryn.Sep 14 2017, 2:43 PM

Just to clarify. This is preventing me to set Filter translations on Meta to "do nothing" by default when using the New filters for edit review feature? Now the default option is "Filter out translations" and I always need to change it manually when I load the recent changes page.

I think that task is a duplicate of T164063.

If I understand correctly, the need is to filter local messages that are in a given language. It requires to:

  • filter (include or exclude) messages that have been locally override, which already exists when you filter Mediawiki namespace.
  • filter (include or exclude) pages in a given language. This is covered by T164063: Filter edits by languages.
jmatazzoni added a comment.EditedOct 12 2017, 10:06 PM

Here is my suggested language for the translate filter UI

Translations

Translations
Changes to translated pages

Translated Site Messages
I don't understand what this is. Can someone please clarify

Not translations
All changes that are not translations.

Questions

  1. What does the "Changes to site messages only" filter bring up? Is it messages that are on pages? Or messages in the interface? And are they only messages that have been translated? I don't understand.
  2. I have written this group so that it will be total coverage. Does that make sense?
  3. I assume the default should be that all the filters are unchecked, meaning everything will be included. @Stryn, that's what you want, right?

Change 383986 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/Translate@master] [WIP] Port Translate filters to new RC filters UI

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

As it currently stands, "Changes to site messages only" does not work by default. The way it was intended to work is to check whether the edit was made in some of registered namespaces. Current filters assume that one of those namespaces is Mediawiki namespace, which is removed from default namespaces long time ago in https://gerrit.wikimedia.org/r/#/c/97699/. Only namespace included by default is Translations namespace. Most of the wikis (or maybe all of wikis, I did not check) which have Translation extension installed, do have it configured to include Mediawiki namespace, so "Changes to site messages only" should work, but currently require configuration to do so. List of wikis that have Translate enabled T164063#3226068.

The way multilingual wikis are supposed to work is having a page such as this one, that can be translated in multiple languages such as Spanish or Czech. Translations to languages that are not default to the wiki (English for example), are marked with Page_title/language-code, like the two linked Spanish and Czech versions. "Show translations only" is targeting those pages that have language code. This may be useful to users only with additional language filtering, to get only translations to specific language. Currently, code for that is in CleanChanges extension.

On the other hand, "Changes to site messages only" targets messages that don't have language code (apparently all articles in Translations namespace do have language code). These are more custimizations (only available to users with the 'editinterface' permission) rather than tranlations, as this checks for Mediawiki namespace (which was, but not anymore included by default). The MediaWiki namespace is used to hold system messages and other important content. For instance, MediaWiki:Common.css is the system message that holds the CSS code that is loaded for all users for each page. Changes picked by "Changes to site messages only" are, for example, MediaWiki:Common.css, but not MediaWiki:Common.css/fr or other messages for specific languages.

As far as filters go, there is no per-user preference to set default filter behavior for translatons filters. Only configurable through wiki default parameter override, affecting all users of that wiki. See T159795#3648295. "Filter out translatons" must be included, as it is currently default value. There was also some discussion about changing default value in T59391#631471.

We will probably need to change behavior of these filters, both for old UI and new UI.

I'm confused. I think we have all the needed filters (quite) already implemented.

  • to filter translations, filter Translations: namespace
  • to not filter translations, exclude Translations: namespace
  • to monitor changes on site messages only, filter Mediawiki: namespace

Don't we have all needed filters already implemented? Or am I missing something?

If we have all of those implemented, a good improvement would be a way to choose the language you want to check makes it a bit useless. Definitely a killing feature. If I've understood correctly, @Petar.petkovic has a way to do it using CleanChanges.

It really depends on what we want.

For example what of a following is a translation:

  1. Page/fi (translation page of a translatable page)
  2. Translations:Page/4/fi (translation unit of a translatable page)
  3. FreeCol:unit.attack/fi (translatewiki.net has lot of additional namespaces that contain translations, Meta has CNBanner, ...)
  4. MediaWiki:Jan/fi (local translation override of an interface message)
  5. MediaWiki:Jan (local override of an interface message)
  6. MediaWiki:Common.css (local override of non-interface message)

Currently Translate treats 2,3,4 (but not 1) as translations.

Some use cases:

  • As a user, I don't want to see two edits for each translatable page update (page itself + translation unit) [hide NS_TRANSLATIONS]
  • As a monolingual user, I might not want to see changes to translation pages either [hide anything that ends with a '/' + language code]
  • As a translator, I want to see only recent translation in my language [show only pages ending in '/' + language code]
  • As a admin (of translatewiki.net) I want to see changes that affect site (security, functionality, ...) in MediaWiki namespace, ignoring all interface message translations that also happen in that namespace. [Show only pages not ending with a language code in NS_MEDIAWIKI]
  • As a translator of translatewiki.net, I want to see only changes in my language to a particular project (MediaWiki, Wikipedia android app,...) [Show only pages that belong to translation group X and ends in '/' + language code]

The 3 first points of your user cases are user cases we can have on wikis where translations exists ans should be implemented IMO. The two remaining examples are unique to translatewiki, right?

Change 383986 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Port Translate filters to new RC filters UI

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

Checked in meta.betalabs (Extension:Translate enabled). It seems that currently pages cannot be translated there filed as T180841: [betacluster] Special:Translate does not allow to translate article content - multiple "Uncaught SyntaxError: Unexpected token < in JSON at position 0"

Checked

  • comparing with "old"(not New filters) Translate filters, new Translate filters work without any discrepancies
  • checked the new filter for 'Site only message' filter - works as expected.

QA Recommendation: Resolve

Nemo_bis triaged this task as Normal priority.Nov 18 2017, 12:00 PM

I have enabled the new filters on translatewiki.net.

I'm bouncing this back to In Development to fix a small style point: In all other filter groups, the "not" option ("not bot" "not on Watchlist," "not the latest revision") comes last in the group. But I'm seeing the "Not translations" filter first (see screenshot from Meta below).

Please re-order the filters as follows:

  • Translations
  • Site messages
  • Not translations

Change 393671 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/Translate@master] Reorder Translate filters

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

Change 393671 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Reorder Translate filters

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

Etonkovidova added a comment.EditedNov 28 2017, 11:33 PM

@Nikerabbit On translatewiki.net, 'Human (not bot)' filter title is 'hidehumans' - is it intentional?

Checked with the re-ordered filters - no issues found.

QA Recommendation: Resolve

@Nikerabbit On translatewiki.net, 'Human (not bot)' filter title is 'hidehumans' - is it intentional?

Someone had translated our site message for it, then blanked it thinking it would get rid of it. I have now deleted that page.

Petar.petkovic closed this task as Resolved.Dec 21 2017, 11:41 AM
Petar.petkovic removed a project: Patch-For-Review.