View Single Post
Old 12-26-2015, 04:18 AM   #41
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,739
Karma: 24031403
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Jellby View Post
I always wonder, on the fundamental side of the problem (i.e., about the ordering itself, not about how to achieve it), what is the best way of sorting multilingual entries.
AFAIK, c++ has locale-aware sort functions, e.g. collate, which produces the following sort orders, depending on the locale:

Code:
Default locale collation order: Zebra ar förnamn zebra ängel år ögrupp
English locale collation order: ängel ar år förnamn ögrupp zebra Zebra
Swedish locale collation order: ar förnamn zebra Zebra år ängel ögrupp
However, as KevinH has said, Sigil doesn't do any sorting, but relies on QString comparison, which is a locale-unaware Qt library function. I.e., the only way to get the desired sort order would be to add the unaccented word in the second column.

For example, if you change the last entry to:

Code:
âge    ages/âges de la vie
It'll be listed under A:

Code:
Acton
    Acton Harold 1
agenda 1
ages
    âges de la vie 1
Agnelli
    Agnelli Gianni 1
agrafe 1
Obviously, as post-editing step, you'd have to change "ages" back to "âges." This could be handled by a Python script, either as a Sigil plugin, as suggested in this post, or a stand-alone script.
Doitsu is offline   Reply With Quote