Page MenuHomePhabricator

CTA for page editors for marking page for translation
Closed, ResolvedPublic8 Estimated Story Points

Description

image.png (440×1 px, 60 KB)

Scoping:

  • Defining for which pages this should be shown
    • New configuration to specify namespaces
    • Hard-coded logic for other criteria like content model, etc. as needed
    • Further configuration/hooks can be added as needed in the future
    • Not on pages with translation tags already present
  • Defining for which users this should be shown
    • Recent editors of the page
    • Only to non-translation admins
  • Add the banner to top of the page

Event Timeline

Nikerabbit raised the priority of this task from Medium to High.Apr 8 2024, 1:33 PM
Nikerabbit set the point value for this task to 8.
  • Suggest to start with ContentNamespaces and content model being wikitext

On Commons, $wgContentNamespaces consists of NS_MAIN and NS_FILE. Currently there is one translatable gallery (mainspace page) and two translatable file subpages (the latter are workarounds for T44495 and don’t even work, by the way). In contrast, there are over 1500 Commons- (NS_PROJECT), 660 Template- (NS_TEMPLATE) and 53 Help-namepsace (NS_HELP) pages as well as a few others. Using $wgContentNamespaces on Commons would be clearly more harmful than useful (who wants to translate file description pages?). It’s not that off on other wikis, but NS_TEMPLATE and NS_PROJECT are often non-content namespaces that use translation a lot; on Meta and mediawiki.org, NS_CATEGORY is also often translated despite not being a content namespace.

I think this feature should use a configuration variable, and only a configuration variable, from the very beginning. (Maybe a hook as well, but given how much difference there is between the use of the same namespace, like NS_MAIN or NS_CATEGORY, across wikis, it doesn’t sound very useful.)

Thanks for the feedback. I've updated the task description based on your suggestion.

Change #1026151 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] WIP: Add CTA to mark page for translations to article headings

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

Screenshots from my dev machine:

Timeless

image.png (498×1 px, 45 KB)

Vector

image.png (585×1 px, 56 KB)


The banner is displayed in the following scenario:

  • Page namespace is defined in the list TranslatePageTranslationCtaNamespace
  • Content model of the current page is wikitext
  • The page being viewed is not a translation page
  • The page does not have the <translate> tags
  • The user viewing the page is not a translation administrator.
  • The user viewing the page has edited the page in the last 4 days (recent editor).

Change #1026151 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Add call to action to mark page for translations to article headings

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

Change is deployed on translatewiki.net; no way to verify the changes for now since it's not enabled.

  • Defining for which pages this should be shown
    • Page namespace is defined in the list TranslatePageTranslationCtaNamespace
    • AND Content model of the current page is wikitext
    • AND The page being viewed is not a translation page
    • AND The page does not have the <translate> tags
  • Defining for which users this should be shown
    • The user viewing the page has edited the page in the last 4 days (recent editor).
    • AND The user viewing the page is not a translation administrator.
  • Add the banner to top of the page
    • Banner is added to the top of the page
    • Redirects to ?Special:PageTranslation&do=settings&target=PageName

Moving to Done column, but leaving it open to observe if any issues are caused by this change.