mysociety / yournextrepresentative

A website for crowd-sourcing structured election candidate data
https://candidates.democracyclub.org.uk/
GNU Affero General Public License v3.0
56 stars 21 forks source link

use Popolo's sort_name for sorting candidates alphabetically #947

Open mhl opened 8 years ago

mhl commented 8 years ago

At the moment there are various places (see git grep 'split()\[-1\]') where we pick the last white-space separated part of the name to sort on. This doesn't work even in the UK, where some people have double-barrelled surnames that aren't hyphenated - in other countries, where sorting conventions vary, it's even less likely to be right.

Popolo has a sort_name field which we should use instead. To use this we would need to:

wfdd commented 8 years ago

This is still not enough for sorting to work properly in other languages; the various built-in sort functions operate on bytes (i.e. Unicode code units), the order of which may or may not correspond to alphabetical order - see #937.