Quote:
Originally Posted by arspr
Unless you can give a really, REALLY good hint, I feel the template coding can be really painful because you have to:
|
Here is a hint.
Go to preferences -> template functions. Enter:
Function: names_to_sort
Arg count: 1
Documentation: Given an author-like string, return the author-sort for it.
Program code:
Code:
def evaluate(self, formatter, kwargs, mi, locals, names):
from calibre.ebooks.metadata import authors_to_sort_string, string_to_authors
return authors_to_sort_string(string_to_authors(names))
Press the Create button, then the Apply icon. Now create a custom column that you want to contain the sort string for an author-like field and enter the template. For 'authors' the template would be:
Code:
{authors:names_to_sort()}
Change 'authors' to the lookup name for your translator column.