Page MenuHomePhabricator

Translate extension fails to create translations of module documentation pages
Closed, ResolvedPublicBUG REPORT

Description

Steps to Reproduce:

Mark the documentation of a module for translation (this happened on MediaWiki.org with Module:Transcluder/doc).

Try to translate the page into another language.

Actual Results:

When the page is marked for translation the "translation" into the source language (Module:Transcluder/doc/en) was not created.

When the page is translated into a new language, the translation page (Module:Transcluder/doc/<language code>) was not created

Expected Results:

Translations of module documentation pages are automatically created in the same manner as translations of all other pages.

Event Timeline

I suspect the issue may be due to the fact that when creating subpages of a module or the /doc subpage, the Translate extension (or MediaWiki core) defaults to the content model of the module.

Tacsipacsi added a subscriber: Tacsipacsi.

It’s set by Scribunto at rELUA includes/common/Hooks.php:256-273 (at 3b2d40f28de5), not by core or Translate. This code already exempts TemplateStyles (T200914), so probably documentation translations can be exempted, too.

Change 616281 had a related patch set uploaded (by Pppery; owner: Pppery):
[mediawiki/extensions/Translate@master] Force translation pages to have same content model as source page

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

The patch seems fine to me. One other idea I had was if we made Scribunto::isDocPage true for /doc and any of its subpages, which would include translation pages. Is there any use case for having Lua pages under Module:Foo/doc/... ? Or any reason we shouldn't do that and only do it for i18n pages?

My patch to the translate extension would be a good idea regardless, as it fixes the case where a non-doc page is manually given the wikitext content model (through an explicit content model change or a move), and then marked for translation.

Change 616281 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Force translation pages to have same content model as source page

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

Pppery closed this task as Resolved.EditedAug 11 2020, 4:26 PM

Confirmed fixed (the linked edit was caused by a null edit to a Translations namespace page)

This seems to have regressed at some point, as FuzzyBot failed to create https://www.mediawiki.org/wiki/Module:Template_translation/doc/en when https://www.mediawiki.org/wiki/Module:Template_translation/doc was marked for translation.

Change 693984 had a related patch set uploaded (by Pppery; author: Pppery):

[mediawiki/extensions/Translate@master] Fix translation of pages with custom content models

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

Change 693984 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Fix translation of pages with custom content models

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