Page MenuHomePhabricator

editintro no longer does language conversion since MediaWiki 1.41+
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

image.png (733×1 px, 210 KB)

MediaWiki doesn't do language conversion on editintro Template:Editprotected/editintro.

What should have happened instead?:
MediaWiki should do language conversion on editintro.

Other information (browser name/version, screenshots, etc.):
In REL1_40, MediaWiki does language conversion on editintro.
https://patchdemo.wmflabs.org/wikis/13f4e080f1/w/index.php?title=Project:沙盒&action=edit&editintro=Template:Editprotected/editintro&uselang=zh-tw&variant=zh-tw

Event Timeline

Good guess, that looks like the cause.

The old code parsed the custom edit intro in "content" mode:

				$this->context->getOutput()->addWikiTextAsContent(
					'<div class="mw-editintro">{{:' . $title->getFullText() . '}}</div>',
					/*linestart*/true,
					$this->mTitle
				);

The new one uses the default mode for localisation messages, which is the "interface" mode:

					$localizer->msg( new RawMessage(
						// Added using template syntax, to take <noinclude>'s into account.
						'<div class="mw-editintro">{{:' . $introTitle->getFullText() . '}}</div>'
					) )->parse()

The reason for this was not documented, so I thought it was a mistake (as it was definitely a mistake in many other cases I've seen that method used).

Change 984842 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@master] Parse custom edit intro as content to enable language conversion

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

Change 984842 merged by jenkins-bot:

[mediawiki/core@master] Parse custom edit intro as content to enable language conversion

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

Change 989928 had a related patch set uploaded (by Winston Sung; author: Bartosz Dziewoński):

[mediawiki/core@REL1_41] Parse custom edit intro as content to enable language conversion

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

Change 989928 merged by jenkins-bot:

[mediawiki/core@REL1_41] Parse custom edit intro as content to enable language conversion

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

Winston_Sung changed the task status from Open to In Progress.Jan 12 2024, 2:56 AM
Winston_Sung assigned this task to matmarex.

Should be deployed next week.