![]() |
#1 |
Leftutti
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 549
Karma: 1717097
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
|
Custom column fails after switching language
It's not a problem for me I only noticed that switching calibre's language causes problems.
My native language is german and switching to english doesn't translate ja/yes, nein/no in the template. |
![]() |
![]() |
![]() |
#2 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,405
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
In this case you can use the check_yes_no() function. It doesn't depend on language. Code:
{:'if check_yes_no('#read', 1, 1, 0) then 'Nicht Gelesen' else 'Gelesen' fi'} |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,207
Karma: 1419197
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Aren't translators supposed not to translate such strings?
|
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,405
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I don't understand. Translators won't see strings in user-defined templates, so there is no opportunity to make the choice.
Templates operate on displayed (formatted) values. For something like a Yes/No column, calibre displays the translated value for the column. You probably would see the same for "Unknown" in authors & titles. That is one reason the check_yes_no() function was added -- to remove dependency on displayed values for yes/no columns in a template. But your question did remind me of another workaround. The template could use raw_field() to get an untranslated value ('true', 'false', 'none'), as in Code:
{:'switch($$#read, 'true', 'Gelesen', 'false', 'Nicht Gelesen', 'Nicht Gelesen')'} |
![]() |
![]() |
![]() |
#5 |
Leftutti
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 549
Karma: 1717097
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
|
I thought it would be a translation nightmare.
I'll try out your suggestions later for future proof Thanks as always, chaley. I want to stress again how great it is that you always help us out. |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,207
Karma: 1419197
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Quote:
Also, there is really nothing to do with translators. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using RE to extract pattern from custom column into another custom column | activedirectory | Library Management | 1 | 12-15-2019 08:07 PM |
Sony book sorting by author fails when creating collections from a custom column | speakingtohe | Devices | 2 | 05-15-2014 01:27 PM |
Custom column returns value based on value of another custom column? | calvin-c | Calibre | 3 | 09-14-2013 02:24 PM |
Custom column listing the tags and language | dpierron | Library Management | 4 | 10-19-2012 07:24 AM |
Switching the language on firmware 1.4.00.23260 | pupeno | Sony Reader | 15 | 06-17-2009 04:58 PM |