View Single Post
Old 02-07-2016, 10:47 AM   #995
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,024
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by firefoxxy View Post
I was wondering if the 'title-sorting' option does not work for me because of my language setting in calibre. (Sorry if this not what it is really called, as I am using the German language version. It's in the basic options of FFF, together with the 'author-sorting'.)

When I download English fiction, a story called 'A Wolf to Potters' stays as it is, while a story called 'Das Vermaechtnis des Severus Snape' is - correctly - changed into 'Vermaechtnis des Severus Snape, Das'. Is there a way to get FFF to sort the English titles too, without having to change the calibre language setting?
That's a Calibre feature. So here's what I've found, but be aware that I may not know all the details.

Look in Calibre Preferences, under Tweaks, search for per_language_title_sort_articles. That is a data structure that defines what words are "articles" for sort strings in different languages.

The comment associated with it says that By default, calibre uses a combination of articles from English and whatever language the calibre user interface is set to. However, in practice it doesn't seem to do that. I suspect the comment is out of date.

I found that by copying the English articles(A,The,An) to the 'deu' settings does what you want. See below:

Code:
# Set the list of words considered to be "articles" for sort strings

per_language_title_sort_articles = {'afr': ("'n\\s+", 'Die\\s+'), 'nld': ('De\\s+', 'Het\\s+', 'Een\\s+', "'n\\s+", "'s\\s+", 'Ene\\s+', 'Ener\\s+', 'Enes\\s+', 'Den\\s+', 'Der\\s+', 'Des\\s+', "'t\\s+"), 'por': ('A\\s+', 'O\\s+', 'Os\\s+', 'As\\s+', 'Um\\s+', 'Uns\\s+', 'Uma\\s+', 'Umas\\s+'), 'ron': ('Un\\s+', 'O\\s+', 'Ni\xc5\x9fte\\s+'), 'hun': ('A\\s+', 'Az\\s+', 'Egy\\s+'), 'spa': ('El\\s+', 'La\\s+', 'Lo\\s+', 'Los\\s+', 'Las\\s+', 'Un\\s+', 'Una\\s+', 'Unos\\s+', 'Unas\\s+'), 'swe': ('En\\s+', 'Ett\\s+', 'Det\\s+', 'Den\\s+', 'De\\s+'), 'ita': ('Lo\\s+', 'Il\\s+', "L'", 'La\\s+', 'Gli\\s+', 'I\\s+', 'Le\\s+'), 'fra': ('Le\\s+', 'La\\s+', "L'", 'Les\\s+', 'Un\\s+', 'Une\\s+', 'Des\\s+', 'De\\s+La\\s+', 'De\\s+', "D'"), 'eng': ('A\\s+', 'The\\s+', 'An\\s+'), 'tur': ('Bir\\s+',), 'deu': ('A\\s+', 'The\\s+', 'An\\s+', 'Der\\s+', 'Die\\s+', 'Das\\s+', 'Den\\s+', 'Ein\\s+', 'Eine\\s+', 'Einen\\s+', 'Dem\\s+', 'Des\\s+', 'Einem\\s+', 'Eines\\s+'), 'ell': ('O\\s+', 'I\\s+', 'To\\s+', 'Ta\\s+', 'Tus\\s+', 'Tis\\s+', "'Enas\\s+", "'Mia\\s+", "'Ena\\s+", "'Enan\\s+")}
You can test this by using Calibre's Edit metadata on an existing book. The button next to the title edit boxes applies the 'sort' pattern. See attached.
Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	267
Size:	6.8 KB
ID:	146113  
JimmXinu is offline   Reply With Quote