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?

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.

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.

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".

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.

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 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.

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.

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.