Last modified: 2014-11-17 10:35:28 UTC
Split off from bug 164, this is a tracking bug for areas that need improved client-side sorting.
*** Bug 8732 has been marked as a duplicate of this bug. ***
Collation can already be adapted using: mw.config.set('tableSorterCollation',{'Ä':'A','Ö':'O','Ü':'U','ä':'a','ö':'o','ü':'u','ß':'ss'}); The question is, how do we do this automatically. Create a JS version of the Collation class ?
Easiest approach would probably to in the parser: read through the table, generate binary sortkeys, turn them into some non-binary form, put it in a data attribute. The collation class (or rather the third party icu library used by it) is rather complex. I'm doubtful we could re-create it in javascript sanely. For example, it needs to do sorting on three different levels, be able to dynamically insert new "in-between" values, etc. We also don't even know what rules are being used at runtime (as the php bindings don't expose that, and it changes with version). OTOH, I suppose it doesn't need to be exactly the same. Fixing just the really bad mismatches in sorting behaviour might be good enough.