martindholmes / BreezeMap

BreezeMap is a project to create a simple user interface for interactive map and facsimile editing based on TEI XML and OpenLayers 4+.
MIT License
11 stars 3 forks source link

Allow use of collations for sorting #17

Closed martindholmes closed 3 years ago

martindholmes commented 4 years ago

All the sorting of feature lists, taxonomies and so on is done using a straight comparison function. It would be better to allow configuration of the object with a language tag, and then instantiate a global Intl.Collator object with that language, and use it something like this:

[global]? var collator = new Intl.Collator(lang);

then: thisCatFeatures.sort(function(a, b) { var aName = a.getProperties().name.toUpperCase(); var bName = b.getProperties().name.toUpperCase(); return collator.compare(aName,bName); });

martindholmes commented 3 years ago

Working on this in issue-17-collations branch.

martindholmes commented 3 years ago

Done and tested.