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 [[ https://github.com/wikimedia/operations-mediawiki-config/blob/master/wmf-config/InitialiseSettings.php#L8323 | 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 [[ https://fi.wikipedia.org/w/index.php?title=Toiminnot:Väärinkäyttöloki&wpSearchFilter=180 | abusefilter log ]] from new users who are trying to save pages to article namespace. We [[ https://fi.wikipedia.org/wiki/Wikipedia:Kahvihuone_(tekniikka)#Tuoreen_käyttäjän_käännöksiä_päänimiavaruuteen | 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 [[ https://quarry.wmcloud.org/query/94346 | quarry 94346 ]]) Similarly, in English Wikipedia there are hits to [[ https://en.wikipedia.org/w/index.php?title=Special:AbuseLog&wpSearchFilter=782 | abusefilter ]].
== Design Details ==
=== Stage 1: Initial Warning (Translation Start) ===
|{F62378534 width=320}|
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) ===
|{F62378425 width=320}|
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"
4. "Learn more" link works and goes to wiki's help page
5. X button dismisses the banner
6. User can continue translating after dismissing
7. 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
| **AC** | **Status** | **Details** |
| ----- | ----- | ----- |
| 1 | ❌|T396142#11104098
| 2 | ✅|T396142#11104098
| 3 | ❓|T396142#11104098
| 4 | ❓|T396142#11104098
| 5 | ✅|T396142#11104098
| 6 | ❌|T396142#11104098