Original feature request: "There should be a way to not use the actual page titles but something else instead in the category listing. Would be useful for example translated titles."
Longer version:
In categories, the unformatted page name of a page is displayed. This is not especially desirable:
Names of pages should be formatted according to orthographic convention, and so they are consistent with the article's title. Most here will be familiar with italicising names of books and movies, ships, etc. https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Titles_of_works
This is a major issue. {{DISPLAYTITLE}} is used on (I conservatively estimate) about 20% of English Wikipedia pages, meaning this impacts more than 1 million pages on English Wikipedia alone. There is justification for arguing that this is currently the single biggest display-related issue in MediaWiki. It's reasonable to bump this up to High priority.
There are also cases where changing the page name displayed in a category may be useful:
- To hide the namespace part of a page's name in a category. This part is often redundant, and can be ugly.
- To override a technical restriction on the displayed page name. This is not presently how Wikipedia does it, but there may be some advantages to this approach, and other wikis may wish to do this, even if Wikipedia is resistant.
- etc
- The original report here (which is very short and hand-wavy) talks about how to deal with multiple languages. Wikimedia Commons doesn't handle multiple languages particularly well. Showing translated page and category names might be a little more complicated that outlined here, and potentially should be a subbug.
Solution 1
The first solution would be to use the {{DISPLAYTITLE}} value of a page. However, there are disadvantages to this; notably, it would generate a one-to-many relationship whereby the {{DISPLAYTITLE}} value would be used for two different things (even if usually related), and would always be displayed in categories. But there is potential that displayed name change is only desired in some of these categories. Nevertheless, this might probably be easiest/quickest to implement.
It offers some option to change the language if {{DISPLAYTITLE}} were set to be language-dependent.
Solution 2
An alternative solution would be to set a new value, suggest {{DISPLAYCAT}}, which will serve as the default value for display in categories. This can be set in the Wikitext in the same way as {{DEFAULTSORT}}. For example, {{DISPLAYCAT:USS ''Enterprise''}} would set the display to USS Enterprise. If {{DISPLAYCAT}} is not set, it should default to {{PAGENAME}}. There might have to be a $wgRestrictDisplayCat setting if people are too scared of vandals changing the displayed name (though with automatic tagging of changes to this, is this really necessary?)
For display in individual categories, I suggest using the pipe trick. Currently, the first entry after the pipe overrides {{DEFAULTSORT}} for that category, e.g. in [[Category:Foo|bar]]. If another pipe is added here, we can get to [[Category:Foo|bar|''qzzy'']] where qzzy is displayed as the page's title in [[category:Foo]]. If a double pipe is used, {{DEFAULTSORT}} would be used for sorting by default, e.g. [[category:foo||''qzzy'']] would sort under Foo. And if only the first pipe is present, e.g. [[category:foo]] then it would use {{DISPLAYCAT}} if defined elsewhere, or Foo if not, for backwards compatibility.
This offers maximum flexibility, and the possibility that some language-dependent variable could be set within the second pipe and displayed if the user's language differs from the default English value.
As far as I can tell, there should be nothing in here that's logically impossible or too resource-intensive. All the required code is already used either in the {{DISPLAYTITLE}} or {{DEFAULTSORT}} features.