Page MenuHomePhabricator

User categories creation should be able to use templates
Closed, ResolvedPublic

Description

New features

This is an update for what kind of content can be stored within MediaWiki:Babel-autocreate-text-levels and MediaWiki:Babel-autocreate-text-main: they now support templates, which allows you to create a single design and categorize categories.

See good examples at

  1. French Wikipedia:
    1. Template: https://fr.wikipedia.org/wiki/Modèle:Catégorie_langue
    2. Message: https://fr.wikipedia.org/w/index.php?title=MediaWiki:Babel-autocreate-text-levels&action=edit
    3. Result: https://fr.wikipedia.org/wiki/Catégorie:Utilisateur_ota-0
    4. Message: https://fr.wikipedia.org/w/index.php?title=MediaWiki:Babel-autocreate-text-main&action=edit
    5. Result: https://fr.wikipedia.org/wiki/Catégorie:Utilisateur_ota
  2. Russian Wikipedia:
    1. Template: https://ru.wikipedia.org/wiki/Шаблон:Категория_Вавилона
    2. Message: https://ru.wikipedia.org/w/index.php?title=MediaWiki:Babel-autocreate-text-levels&action=edit
    3. Result: https://ru.wikipedia.org/wiki/Категория:User_ik-5
    4. Message: https://ru.wikipedia.org/w/index.php?title=MediaWiki:Babel-autocreate-text-main&action=edit
    5. Result: https://ru.wikipedia.org/wiki/Категория:User_ik

Description

When babel creates a new user category using MediaWiki:Babel-autocreate-text-levels and MediaWiki:Babel-autocreate-text-main, it interprets the content of the page. It means that if a template is used for these categories (as on WP:FR), we cannot make babel generate the pages with the template as this one is transcluded. We tried on WP:FR (see this message) to use the template, and got this behavior instead of that one.

As suggested by an administrator on this page, this has to do with the function BabelAutoCreate::create(), which should use ->plain() instead of ->text().
I'm not familiar with the WM extensions code, so I wouldn't know if this is the correct action to take. However, using templates is a basic action of wikipedia, and babel should support it.

I found the T168610 task in which the same issue is reported.

Thanks, Epok.

Event Timeline

Epok updated the task description. (Show Details)

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

[mediawiki/extensions/Babel@master] Allow babel categories to autocreate using templates

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

Thanks @Pppery for claiming this task.

Change 881947 merged by jenkins-bot:

[mediawiki/extensions/Babel@master] Allow babel categories to autocreate using templates

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

Iniquity reopened this task as Open.EditedMar 26 2023, 3:09 PM
Iniquity added a project: User-notice.

I will open task for publishing in TechNews:

Tech/News Proposed Copy
The system for creating automatic categories for the Babel extension has had several important changes and fixes. One of them allows you to insert templates for automatic category descriptions on creation, allowing you to categorize categories. [https://phabricator.wikimedia.org/T211665], [https://ru.wikipedia.org/wiki/Шаблон:Категория_Вавилона], [https://phabricator.wikimedia.org/T64714], [https://phabricator.wikimedia.org/T170654], [https://phabricator.wikimedia.org/T184941], [https://phabricator.wikimedia.org/T33074]

I suggest adding a brief summary to the top of the Task Description, of what (if anything) editors need to do on their local wikis, in order to use this new functionality. (for people looking here from Tech News).
If I understand correctly, it's essentially something like....

This is an update for what kind of content can be stored within MediaWiki:Babel-autocreate-text-levels and MediaWiki:Babel-autocreate-text-main.
They now support templates.
See good (????) examples at https://fr.wikipedia.org/w/index.php?title=MediaWiki:Babel-autocreate-text-levels&action=edit and https://fr.wikipedia.org/w/index.php?title=MediaWiki:Babel-autocreate-text-main&action=edit and the results at https://fr.wikipedia.org/wiki/Catégorie:Utilisateur_ota-0 and https://fr.wikipedia.org/wiki/Catégorie:Utilisateur_ota

I suggest adding a brief summary to the top of the Task Description, of what (if anything) editors need to do on their local wikis, in order to use this new functionality. (for people looking here from Tech News).
If I understand correctly, it's essentially something like....

This is an update for what kind of content can be stored within MediaWiki:Babel-autocreate-text-levels and MediaWiki:Babel-autocreate-text-main.
They now support templates.
See good (????) examples at https://fr.wikipedia.org/w/index.php?title=MediaWiki:Babel-autocreate-text-levels&action=edit and https://fr.wikipedia.org/w/index.php?title=MediaWiki:Babel-autocreate-text-main&action=edit and the results at https://fr.wikipedia.org/wiki/Catégorie:Utilisateur_ota-0 and https://fr.wikipedia.org/wiki/Catégorie:Utilisateur_ota

As usual, you're right! I thought about it, I'll add it now :)