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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 08-10-2009, 05:43 AM   #1
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Translating long/complex strings

I'm finishing a revision of the Spanish translation of Calibre, and I'm wondering what I should do with long or complex strings...

It seems some of the strings are used as floating tooltips, but the text is not wrapped to a manageable size, so it's displayed in the GUI as a single long line. I guess I could add hard breaks (\n) in the translated string, but would it be better if the GUI did wrap tooltips to a narrower size? (For instance: "The base font size in pts. All font sizes in the produced book...")

There are a couple of strings that include even an HTML header, notably the main text in Advanced preferences. Is this really needed? It even sets the font name! The other instance looks like an empty html file (search for DTD in the .po file).

By the way, it seems the branches in the plugin list are named by joining two strings, one with the generic name (Metadata reader, File type, etc.) and the other with " plugins". This works fine for English, but not for other languages where the modifier comes after the noun (i.e., it would be something like "Plugins for (whatever)". Could this be changed to "%s plugins" or something like that?
Jellby is offline   Reply With Quote
Old 08-10-2009, 08:10 AM   #2
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
I would recommend against hard line breaks. Wrapping of text in tooltips is handled at the toolkit level but as you've found it doesn't do a very good job. Still it would be better not to have two wrappings competing for each other. At least not until some testing has been done to ensure there won't be issues.

Quote:
Originally Posted by Jellby
By the way, it seems the branches in the plugin list are named by joining two strings, one with the generic name (Metadata reader, File type, etc.) and the other with " plugins".
Can you give me an example string or a file name. I'm not exactly sure where in the source tree this is.
user_none is offline   Reply With Quote
Old 08-10-2009, 08:51 AM   #3
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by user_none View Post
I would recommend against hard line breaks. Wrapping of text in tooltips is handled at the toolkit level but as you've found it doesn't do a very good job. Still it would be better not to have two wrappings competing for each other. At least not until some testing has been done to ensure there won't be issues.
That's what I thought, but I encounter several "\n" in the original English strings. Most are in items corresponding to command line help, where I guess they're wanted, but some of them seem to be in GUI items too.

Quote:
Can you give me an example string or a file name. I'm not exactly sure where in the source tree this is.
Sure:

#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/config.py:168
msgid " plugins"
msgstr ": complementos"

#: /home/kovid/work/calibre/src/calibre/customize/__init__.py:182
msgid "Metadata reader"
msgstr "Lector de metadatos"

In English that makes "Metadata reader plugins". In Spanish it should be "Complementos de lectores de metadatos", but due to the way it's coded (the two strings seem to be concatenated), I had to make it "Lector de metadatos: complementos".
Jellby is offline   Reply With Quote
Old 08-10-2009, 12:53 PM   #4
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
In the meantime, the Spanish translation is finished.

I tried to make it consistent, and to keep the hotkeys unique, at least in the dialogs I could reach. There's still more work to do, like chosing better verb declinations for tooltips and similar things.
Jellby is offline   Reply With Quote
Old 08-10-2009, 01:02 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That's because I hate writing two strings, one for the CLI and one for the GUI, so I just recycle the CLI strings in the GUI. It's sub-optimal, but since calibre already has over a 1300 strings, I think it's worth the tradeoff.

Unfortunately, "Metadata reader" is the string describing plugin type and the GUI just adds plugin to it when creationg the list. I'm not sure how that can be handled multilingually.

I'll fix the HTML fragments in the next release.
kovidgoyal is offline   Reply With Quote
Old 08-10-2009, 01:04 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by Jellby View Post
In the meantime, the Spanish translation is finished.

I tried to make it consistent, and to keep the hotkeys unique, at least in the dialogs I could reach. There's still more work to do, like chosing better verb declinations for tooltips and similar things.
Thanks, your updates will be in 0.6.6
kovidgoyal is offline   Reply With Quote
Old 08-10-2009, 01:13 PM   #7
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by kovidgoyal View Post
Unfortunately, "Metadata reader" is the string describing plugin type and the GUI just adds plugin to it when creationg the list. I'm not sure how that can be handled multilingually.
Can't you use a format string like "%s plugins", which I could then translate as "Complementos de %s"?
Jellby is offline   Reply With Quote
Old 08-10-2009, 01:15 PM   #8
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Perhaps something to consider for the future might be to introduce numeric placeholders, "%1", "%2", etc, such as languages like C# use. That allows you to easily copy with different word orders in different languages.
HarryT is offline   Reply With Quote
Old 08-10-2009, 01:34 PM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by Jellby View Post
Can't you use a format string like "%s plugins", which I could then translate as "Complementos de %s"?
I'm confused, how's that different from concatenation?
kovidgoyal is offline   Reply With Quote
Old 08-10-2009, 01:55 PM   #10
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by kovidgoyal View Post
I'm confused, how's that different from concatenation?
It is concatenation, but a concatenation where the order can be controlled. What you have now in that specific case is a fixed-order concatenation (in other cases you use %s and %d already).
Jellby is offline   Reply With Quote
Old 08-10-2009, 02:01 PM   #11
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
I think he is suggesting that if one string had a %s placeholder to show where the other string was substituted, he could he could use a differernt format string in another language to control where the substition was placed. I would have thought this should be easy in Python as it uses C/C++ type format strings.
itimpi is offline   Reply With Quote
Old 08-10-2009, 04:22 PM   #12
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You mean something like

Code:
"%(type)s %(plugin)s"%dict(type="Metadata reader", plugin="plugin")
kovidgoyal is offline   Reply With Quote
Old 08-10-2009, 04:36 PM   #13
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Done.
kovidgoyal 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
Translating indie authors Kumabjorn General Discussions 19 06-22-2012 04:58 AM
Translating OpenInkpot is easy! How to contribute your language to OI. Hanno OpenInkpot 14 03-26-2011 04:02 AM
Translating MR stories Verencat Lounge 11 05-31-2009 12:00 PM
Translating entire pages RickyMaveety Lounge 3 02-10-2009 12:31 PM
converting long, somewhat complex docs to eReader Richard Maseles Other formats 4 01-07-2009 05:28 PM


All times are GMT -4. The time now is 03:46 PM.


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