|
|
#1 |
|
Connoisseur
![]() Posts: 62
Karma: 10
Join Date: Mar 2019
Device: Kindle 3 Paperwhite
|
2-characters language code
Seems template expression {languages} returns (ISO 639.2) 3-characters language code (actually "terminology" variant).
fra for French, deu for German, ces for Czech, etc. Is there a way how to get (ISO 639.1) 2-characters code? fr, de, cs, ... |
|
|
|
|
|
#2 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,529
Karma: 8075744
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
No, there isn't, in the template languge. It might be possible in a python template. I would need to check the calibre API, which I can't do at the moment.
|
|
|
|
| Advert | |
|
|
|
|
#3 | |
|
Connoisseur
![]() Posts: 62
Karma: 10
Join Date: Mar 2019
Device: Kindle 3 Paperwhite
|
It's not particulary important. 2-character language codes just seem more readable to me.
Although... Seems Calibre writes 3-chars into OPF of converted e-books... Isn't _this_ behavior in contrary of EPUB standard? I mean: Quote:
Last edited by quinta@ebf.cz; 02-06-2023 at 07:00 PM. |
|
|
|
|
|
|
#4 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,274
Karma: 16800000
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
Quote:
I think it may use a 3-char code (e.g. eng) in its own main database plus the metadata.opf backup file stored with each book record in the calibre library. |
|
|
|
|
|
|
#5 | |
|
Connoisseur
![]() Posts: 62
Karma: 10
Join Date: Mar 2019
Device: Kindle 3 Paperwhite
|
Quote:
- library metadata.opf file uses 3-chars, as mentioned - conversion to epub makes 2-chars (even if there are only 3-char sources in library...) So 3-chars "issue" actually detected just in azw3. |
|
|
|
|
| Advert | |
|
|
|
|
#6 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,172
Karma: 92500001
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
Where in the azw3 file are you seeing this? If it is in the OPF file as shown by the calibre editor then you should be aware that is a recreation of what the equivalent EPUB metadata would be for the book. Kindle formats do not actually have an OPF. They encode metadata in a proprietary way. And the book’s language is actually stored as a number, not an ISO code.
|
|
|
|
|
|
#7 |
|
Connoisseur
![]() Posts: 62
Karma: 10
Join Date: Mar 2019
Device: Kindle 3 Paperwhite
|
As you said. In OPF file, when AZW3 is opened in Calibre editor... Thx for background info.
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Language code ignored in Edit Metadata screen? | cloggy | Conversion | 5 | 06-05-2014 04:36 AM |
| Code view displays square box instead of non latin characters | mashru | Sigil | 10 | 08-20-2013 12:09 PM |
| Template language query. Removing all text after a set of characters | da_jane | Calibre | 1 | 12-14-2012 02:37 PM |
| Programming language code snippets in ebooks? | Connochaetes | Writers' Corner | 7 | 10-18-2010 03:43 PM |
| National characters in .js code | mkaluza | Sony Reader Dev Corner | 1 | 08-28-2008 11:42 AM |