Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 02-07-2020, 03:14 AM   #1
ctop
Enthusiast
ctop is on a distinguished road
 
Posts: 47
Karma: 60
Join Date: Jun 2008
Device: zaurus->palm->iPad->Sony PRS-T1,T2,T3->Kobo Forma&Likebook Ares
Template for folder/filename for Author/Title with Chinese characters

Hi there,
Not sure if this is the right place to post, so please bear with me.
I am trying to construct a template that will create a folder hierarchy on the device. I want to have it start with the first character of author_sort, then on the next level author_sort and finally the book title. It looks like this:

{author_sort:.1}/{author_sort}/{title}

This works very nice for books in English or German, but I also have Chinese and Japanese books in my library. For a Chinese book (Author: 李百药 Title: 二十四史-北齐书), it will come out like this:

Li/Li Bai Yao/Er Shi Si Shi -Bei Qi Shu.epub

This somehow in the background converts the Chinese characters to an alphabetic representation. This part is fine with me, because I understand it wants to work across platforms. However, this conversion should be applied *before* getting the first character, because the Latin representation of one Chinese character will typically be more than one character. So what I expect it should like like is as follows:

L/Li Bai Yao/Er Shi Si Shi -Bei Qi Shu.epub

Is there a way to achieve this? Or has this to be fixed in Calibre?

All the best,

Ctop
ctop is offline   Reply With Quote
Old 02-07-2020, 06:37 AM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 18,409
Karma: 30695818
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
I think the following will work:

Code:
{:'substr(transliterate(field("author_sort")),0,1)'}/{author_sort}/{title}
I have one book in my library with a Japanese title and author. The above produced a "W" for the first character when I used the Template editor. I haven't tried sending it to a device.
davidfor is offline   Reply With Quote
Advert
Old 02-07-2020, 08:37 AM   #3
ctop
Enthusiast
ctop is on a distinguished road
 
Posts: 47
Karma: 60
Join Date: Jun 2008
Device: zaurus->palm->iPad->Sony PRS-T1,T2,T3->Kobo Forma&Likebook Ares
Wow, indeed it does work beautifully! Thank you so much!

Ctop
ctop is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing characters in title & author April Calibre 2 06-19-2018 01:19 PM
Import Author and Title from Filename & Cover from File Alcohol Library Management 3 06-25-2017 12:19 PM
Changing metadata(title and author) in bulk/by macro from filename possible? thosedays Reading and Management 0 10-20-2016 09:17 AM
importing PDF with author, title in filename autchirion Library Management 3 02-22-2011 12:46 PM
Non-English characters in title / author lejuan Calibre 7 01-18-2010 04:52 PM


All times are GMT -4. The time now is 04:58 AM.


MobileRead.com is a privately owned, operated and funded community.