Page MenuHomePhabricator

Allow using the int magic word in Sidebar headings
Closed, InvalidPublicFeature

Description

Feature summary: I would like to be allowed to use the {{int:…}} magic word for the first level (headings) of a list in MediaWiki:Sidebar .

Use case

  • Add a list of items with subitem links in MediaWiki:Sidebar:
* Example
** Page 1|Link name 1
** Page 2|Link name 2
  • Create related system messages MediaWiki:example, MediaWiki:example/fr… and use the int: magic word for labels:
* {{int:example}}
** Page 1|{{int:link-name-1}}
** Page 2|{{int:link-name-2}}
  • Labels for pages are processed but not the first level of the list. Wikitext is printed: {{int:example}}.

Benefits: It should be allowed to use the int magic word for all labels in MediaWiki:Sidebar.

A solution to achieve this

Adding this line after https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/skins/Skin.php;96c301a71369f9bb16bd7367e95a9fe08740b46a$1625

$heading = $messageCache->transform( $heading, false, null, $messageTitle );

Event Timeline

Pols12 subscribed.

I think this is a documentation issue.

Please try the following:

  1. Use * example in your MediaWiki:Sidebar.
  2. Create MediaWiki:example, MediaWiki:example/fr
  3. Browse your wiki with different user languages (you can use uselang URL parameter for this purpose).

I am pretty sure, contrary to what the doc says, you should not use {{int:}} magic word since l10n is automatic (I think).

I just checked and I can confirm localized messages are automatically picked up instead of default one, when available.

I have updated mw:Manual:Interface/Sidebar.

Thank you Pols12. I actually missed some information in the documentation.

My example above was simplified too much. On my mediawiki, I use {{int:…}} with specific labels like {{int:prefix-sidebar-label-1}}. This is useful to manage multiple translations in several contexts.

If it’s not possible to use {{int:…}} on section headings, I’ll use the automatic localization system.

I still don’t understand your use case.

If your MediaWiki:Sidebar contains * {{int:prefix-sidebar-label-1}}, just turn it into * prefix-sidebar-label-1.
If your MediaWiki:Sidebar contains * {{int:h1-prefix}} {{int:h1-suffix}} just turn it into * h1 and create MediaWiki:h1 with {{int:h1-prefix}} {{int:h1-suffix}}.

However, if you still need an improvement, feel free to reopen this task to get an answer from a product owner.

Thank you very much Pols12 for these examples. It solves my problem. I didn’t quite understand how translation works.

Sorry for this useless report :)