See also: https://www.mediawiki.org/wiki/Manual:$wgCategoryCollation

The collation is stored and used by the system as part of the 
https://www.mediawiki.org/wiki/Manual:Categorylinks_table
It determines the sortkey per page linked to a category, which is precalculated 
(for performance reasons)

In general, what you describe sounds like you would want editors to be able to 
configure a collation PER category (likely even per revision of that category). 
That means it would have to be stored in derived data of the categories (and/or 
the revisions) table. A change to this data would then have to fire an update 
job or something.

But as changing the collation requires updating the sortkeys of each of the 
links of a page that comes into the category, it will be difficult to make this 
user changeable, as it is such an expensive operation to change a lot of links 
at the same time.

So:
1. No it is not possible right now
2. yes it does require significant changes
3. making those changes performant would be a significant challenge.

So it is not an easy change and might even require a change to the whole 
concept of how categories are sorted.

DJ



> On 3 May 2025, at 14:26, diskdance via Wikitech-l 
> <wikitech-l@lists.wikimedia.org> wrote:
> 
> Hello,
> 
> I'm currently verifying the technical viability of a category entry sorting 
> problem on Chinese Wikipedia:
> 
> As is known to everyone, Chinese Wikipedia is a multi language variant wiki. 
> This raises a problem as different regions have different Romanization system 
> of Chinese. For instance, Mainland China exclusively use Pinyin as for 
> sorting, while Taiwan uses Zhuyin (or Bopomofo), and there isn't even a 
> popular one in Hong Kong so people tend to use stroke count for sorting. This 
> situation brings requirements for separating category collations by user 
> language variant preference. 
> 
> However, MediaWiki only allows settings a single $wgCategoryCollation 
> currently (https://www.mediawiki.org/wiki/Manual:$wgCategoryCollation). I'm 
> writing to ask:
> Is it possible to have different category collations according to the current 
> language variant?
> If not, does it require a significant amount of work (such as changing 
> database schema) to implement this feature?
> 
> Best regards,
> diskdance
> _______________________________________________
> Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org
> To unsubscribe send an email to wikitech-l-le...@lists.wikimedia.org
> https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/

_______________________________________________
Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org
To unsubscribe send an email to wikitech-l-le...@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/

Reply via email to