Many Wikipedias customized MediaWiki:Categorytree-member-num to show the number of sub-categories, pages and files in the parentheses after the category name, something like (3 C, 5 P, 1 F). Even for English this requires rather weird parser function tricks to make the comma appear in the correct places, and other languages need even stranger tricks - for example in Hebrew "one" comes after the noun, but other numbers come before it, so i had to use #switch and jump through even more hoops to get the comma appear correctly.
I checked the 20 largest Wikipedias and MediaWiki:Categorytree-member-num was customized in all of them in much the same way. Since there apparently is demand for this feature and the eventual functionality is quite the same everywhere, it should be done this way:
- There should be abbreviated localizable messages for C, P and F (category, page, file), something like:
categorytree-category-count-short: {{PLURAL:$1|1 C|$1 C}}
categorytree-page-count-short: {{PLURAL:$1|1 P|$1 P}}
categorytree-file-count-short: {{PLURAL:$1|1 F|$1 F}}
- Then after the category name all the non-zero values can be shown, joined by a comma on the extension code level.
- If all the values are zeroes, the word "empty" should be shown. (There should be another localizable message for this.)
I didn't find any project that implemented this differently, but if there is such a project, it can keep using Categorytree-member-num.
Version: unspecified
Severity: enhancement