Page MenuHomePhabricator

ContentTranslation tool doesn't follow wgContentTranslationPublishRequirements setting
Closed, ResolvedPublic4 Estimated Story PointsBUG REPORT

Assigned To
Authored By
Zache
Jun 5 2025, 5:11 PM
Referenced Files
F65990649: iPhone SE - 9.png
Sep 9 2025, 6:44 AM
F65804335: 2025-08-20_13-10-09.mp4.gif
Aug 20 2025, 8:16 PM
F65804003: 2025-08-20_12-11-40.png
Aug 20 2025, 8:16 PM
F65804035: 2025-08-20_12-13-24.png
Aug 20 2025, 8:16 PM
F65803682: 2025-08-20_11-29-24.mp4
Aug 20 2025, 8:16 PM
F65694943: 2025-07-30_16-57-51.mp4
Aug 20 2025, 8:16 PM
F65694940: Mobile_PublishingWarning.webm
Aug 20 2025, 8:16 PM
F62378534: iPhone SE - 5.png
Jun 18 2025, 3:56 PM

Description

The variable wgContentTranslationPublishRequirements should define the user rights which users would have permission to save the translated articles directly to main namespace (i.e., in Wikipedia to article namespace). Setting is defined in InitialiseSettings.php

For example, in Finnish Wikipedia we added the requirement for autoreview on Jun 8, 2023 (see phab T337412). However, there are still continuous hits in the abusefilter log from new users who are trying to save pages to article namespace. We noticed this as there were also translations from mobile users without the autoreview right which didn't match the abusefilter rule and were saved to article namespace. (see quarry 94346) Similarly, in English Wikipedia there are hits to abusefilter.

Design Details

Stage 1: Initial Warning (Translation Start)

iPhone SE - 9.png (568×320 px, 32 KB)

When users begin a translation, they will see a warning banner that:

  • Component: Codex Message component (cdx-message)
  • Placement: Appears at the top of the translation interface (below the header)
  • Visual specifications:
    • Icon: cdxIconError
    • Icon color: color.red500 (#f54739)
    • Border: color.red500 (#f54739)
    • Text color: #202122
    • Link color: #3366cc
  • Message text: "This community decided to limit publishing to experienced editors"
  • Interactive elements:
    • "Learn more" (blue link #3366cc) - Provides detailed information about requirements
    • Close button (X) - Allows dismissal of the banner
  • Behavior:
    • Non-blocking - users can continue translating after dismissing
    • Appears once per translation session
    • Sets expectation early before users invest significant effort
  • Purpose: Proactive communication to prevent surprise at publishing time

Stage 2: Publishing Error (At Publish Attempt)

iPhone SE - 25.png (568×320 px, 34 KB)

When restricted users attempt to publish:

  • We utilize the existing review and error panel infrastructure (implemented in T260134)
  • This publishing restriction error takes precedence over all other error messages
    • Shown as the first error (1/3) when multiple issues exist
    • Users must acknowledge this restriction before seeing any other validation errors
  • Error message text: "This community decided to limit the publication to experienced editors. You need more edits here first, but you can save as draft or try another language."
  • UI State:
    • The publish button (✓) is disabled/grayed out
    • Cannot proceed to publish until user has required permissions
  • Available actions:
    • "Save as draft" (blue link/button) - Actionable element that:
      • Automatically prefixes the article title with the username
      • Publishing to user's personal namespace instead of main namespace
    • "Learn more" (blue link) - Links to the wiki's Content Translation help page (e.g., [[Wikipedia:Content_translation_tool]] on English Wikipedia)

Acceptance Criteria

Stage 1: Initial Warning

  1. Warning appears when user without permissions starts translation
  2. Shows message: "This community decided to limit publishing to experienced editors"
  3. "Learn more" link works and goes to wiki's help page
  4. X button dismisses the banner
  5. User can continue translating after dismissing
  6. Banner doesn't reappear in same session

Stage 2: Publishing Error

  1. Error appears when restricted user tries to publish
  2. Publish button is disabled
  3. Shows as first error if multiple errors exist
  4. Shows full message with options
  5. "Save as draft" successfully includes username prefix
  6. "Learn more" link works
  7. User cannot bypass to publish without permissions

Derived Requirements

  1. Ensure that when a user without the required wgContentTranslationPublishRequirements permissions starts a translation, a warning banner is shown at the top of the translation interface with the defined message and interactive elements.
  2. Ensure that the warning banner is dismissible, non-blocking, and only appears once per translation session.
  3. Ensure that when a restricted user attempts to publish a translation, the system shows an error message that takes precedence over all other errors.
  4. Ensure that the publish button is disabled for restricted users until they have the required permissions.
  5. Ensure that the "Save as draft" option successfully prefixes the article title with the username and saves the translation in the user’s personal namespace.
  6. Ensure that the "Learn more" links in both the warning banner and publishing error messages lead to the appropriate Content Translation help page for the wiki.
Test Steps

Test Case 1: Ensure Warning Banner Appears for Restricted Users When Starting Translation

  1. Log in with a user account that does not have the required permissions defined by wgContentTranslationPublishRequirements.
  2. Start a new translation in the ContentTranslation tool.
  3. ✅❓❌⬜ AC1: Verify that a warning banner appears at the top of the translation interface with the specified message, "Learn more" link, and dismiss button.

Test Case 2: Ensure Warning Banner Is Dismissible and Non-blocking

  1. While the warning banner is visible, click the close (X) button.
  2. Continue translating after dismissing.
  3. ✅❓❌⬜ AC2: Verify that the banner is dismissed, does not block translation progress, and does not reappear in the same session.

Test Case 3: Ensure Publishing Error Appears for Restricted Users

  1. Using the same restricted account, attempt to publish the translation.
  2. ✅❓❌⬜ AC3: Verify that an error message appears as the first error, with the publish button disabled and the message text displayed correctly.

Test Case 4: Ensure "Save as Draft" Functionality Works

  1. From the publishing error message, select "Save as draft".
  2. ✅❓❌⬜ AC4: Verify that the translation is saved in the user’s personal namespace with the article title prefixed by the username.

Test Case 5: Ensure "Learn More" Links Work

  1. Click the "Learn more" link in the initial warning banner.
  2. Click the "Learn more" link in the publishing error message.
  3. ✅❓❌⬜ AC5: Verify that both links direct to the correct Content Translation help page of the wiki.

Test Case 6: Ensure Restricted Users Cannot Publish Without Permissions

  1. Attempt to bypass the publishing restriction by dismissing the error or retrying publish.
  2. ✅❓❌⬜ AC6: Verify that the publish button remains disabled and the user cannot publish to the main namespace without the required permissions.

QA Results - TestWiki

ACStatusDetails
1Pending T396142#11106764
2T396142#11104098
3per T396142#11106764
4Pending T396142#11106764
5T396142#11104098
6per T396142#11106764

Event Timeline

Zache updated the task description. (Show Details)
SBisson triaged this task as High priority.Jun 5 2025, 7:15 PM
SBisson moved this task from Needs Triage to Drafts and publishing on the ContentTranslation board.

This is the warning shown on the desktop editor:

Screenshot 2025-06-10 at 9.28.11 AM.png (452×2 px, 88 KB)

This is how it is shown in the sidebar of the desktop editor:

Screenshot 2025-06-10 at 9.29.20 AM.png (898×776 px, 111 KB)

Change #1160843 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/ContentTranslation@master] Enforce wgContentTranslationPublishRequirements in publish APIs

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

Change #1160843 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Enforce wgContentTranslationPublishRequirements in publish APIs

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

Change #1168180 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/ContentTranslation@master] Inform editor of unmet publishing requirements

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

@SGautam_WMF I don't see a good way to turn the "save as draft" part of the message into a button that changes the publishing target. Do you think we can live without considering the button to do that is actually the cog icon just above?

@SGautam_WMF do you think the "initial warning" should actually be presented as a warning (yellow instead of red)?

Change #1168180 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Inform editor of unmet publishing requirements

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

Change #1171255 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20250721

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

Change #1171255 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20250721

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

@SBisson Please review AC1, AC3, AC4 and AC6. If you have any questions, please let me know, thanks!

@SGautam_WMF Pending: AC1 and AC4 T396142#11106764

Test Result - TestWiki

Status: ✅ PASS / ❓Need More Info
Environment: TestWiki
OS: macOS Sequoia 15.6
Browser: Chrome 138
Device: MBA
Emulated Device: NA

Test Artifact(s):

https://en.m.wikipedia.org/w/index.php?title=Special:ContentTranslation&filter-type=automatic&filter-id=previous-edits&active-list=draft&from=es&to=en&page=Blue%20Beam%20Project&draft=true&revision=167505658#/sx/sentence-selector

Test Steps

Test Case 1: Ensure Warning Banner Appears for Restricted Users When Starting Translation

  1. Log in with a user account that does not have the required permissions defined by wgContentTranslationPublishRequirements.
  2. Start a new translation in the ContentTranslation tool.
  3. AC1: Verify that a warning banner appears at the top of the translation interface with the specified message, "Learn more" link, and dismiss button.

Warning banner is yellow vs red in the description

Test Case 2: Ensure Warning Banner Is Dismissible and Non-blocking

  1. While the warning banner is visible, click the close (X) button.
  2. Continue translating after dismissing.
  3. AC2: Verify that the banner is dismissed, does not block translation progress, and does not reappear in the same session.

Test Case 3: Ensure Publishing Error Appears for Restricted Users

  1. Using the same restricted account, attempt to publish the translation.
  2. AC3: Verify that an error message appears as the first error, with the publish button disabled and the message text displayed correctly.

UPDATE: Pass per T396142#11106764

As seen in the screenshot compared to the description picture, it has 3 more pages

VideoDescription ScreenshotActual Result Screenshot
2025-08-20_12-13-24.png (460×440 px, 62 KB)
2025-08-20_12-11-40.png (306×411 px, 31 KB)

Test Case 4: Ensure "Save as Draft" Functionality Works

  1. From the publishing error message, select "Save as draft".
  2. AC4: Verify that the translation is saved in the user’s personal namespace with the article title prefixed by the username.

I did not come across an option for "Save as draft"

See AC3

Test Case 5: Ensure "Learn More" Links Work

  1. Click the "Learn more" link in the initial warning banner.
  2. Click the "Learn more" link in the publishing error message.
  3. AC5: Verify that both links direct to the correct Content Translation help page of the wiki.

2025-08-20_13-10-09.mp4.gif (954×852 px, 3 MB)

Test Case 6: Ensure Restricted Users Cannot Publish Without Permissions

  1. Attempt to bypass the publishing restriction by dismissing the error or retrying publish.
  2. AC6: Verify that the publish button remains disabled and the user cannot publish to the main namespace without the required permissions.

UPDATE: Pass per T396142#11106764

The only way to bypass this and publish is by switching the option to "Publish to your Sandbox". Is that ok?

GMikesell-WMF updated Other Assignee, added: GMikesell-WMF.
GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF changed the task status from Open to In Progress.Aug 20 2025, 8:20 PM
GMikesell-WMF moved this task from Needs QA to In-progress on the LPL Hypothesis board.

AC1: It is rightfully described in the task description as a warning, not an error, since it is informing the user of an issue but allowing them to move forward. The design mockup however uses the "error" icon and colors. I asked @SGautam_WMF for confirmation here T396142#11014895

AC3: The error reporting UI will allow paging through errors if there are more than one. That system may or may not be identical to the design mock up but it's not what is being developed here. In my testing, I see that the publishing requirement error shows first, and the MT limit error is next.

AC4: The option to "Save as draft" is available under the cog icon right above the error box. Having this action inside of the error message is technically problematic, as noted here T396142#11006130. I'll let @SGautam_WMF decide if this is acceptable.

AC6: It would be interesting to test that someone with the right permissions on English Wikipedia doesn't see the error and can publish but if it was not the case and blocking everybody I think we would have heard about it.

@SBisson Ok sounds good with AC3 and AC6.

@SGautam_WMF Hi, since we haven’t seen any responses on this for a little while, I’ll go ahead and move this to Sign-Off. You’re welcome to follow up there regarding T396142#11106764
for AC1 and AC4. Thanks!

GMikesell-WMF updated Other Assignee, removed: GMikesell-WMF.
GMikesell-WMF moved this task from Needs QA to Design Signoff on the LPL Hypothesis board.
Nikerabbit set the point value for this task to 4.Sep 4 2025, 10:26 AM

@SBisson Apologies for late reply on this. It's fine to show it as a warning, I have also updated the mockup in task description. As a separate task I would like to explore ways to incorporate settings icon reference in the error message copy given we are not including "safe as draft" action in the copy.