brianreavis / sifter.js

A library for textually searching arrays and hashes of objects by property (or multiple properties). Designed specifically for autocomplete.
1.09k stars 125 forks source link

Implement locale-aware sorting #68

Open nbrustein opened 2 years ago

nbrustein commented 2 years ago

The sort in sifter respects diacritics, but it doesn't support all locales. In my case, I'm specifically running into trouble sorting Chinese in a selectize element.

Seems like the way to make this work would be to switch to using localeCompare for the sorting, but then there would also need to be a way to supply a locale to sifter.