Terms in glossary pane are sorted in specific order with options. It is same for pop-ups.
It is not well explained in user manual.
// After the matched entries have been tokenized and listed,
// we reorder entries as
// 1) by priority
// 2) by length of source text if one contains another (optional)
// 3) by alphabet of source term
// 4) by length of localized term (optional)
// 5) by alphabet of localized term
// Then remove the duplicates and combine t