View Single Post
Old 10-29-2013, 02:42 PM   #18
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,041
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by kovidgoyal View Post
I have added the infrastructure to calibre...
Excellent.

Quote:
Originally Posted by kovidgoyal View Post
1) Mark the strings with _()
2) Put the .mo files into the translations directory, for example translations/de.mo and translations/fr.mo
3) Add load_translations() to the top of the .py files that have translatable strings
Simple enough. Calling load_translations() from each file isn't really an inconvenience, IMO.

It does, however, need to be wrapped with a try/except or a calibre version number check if a plugin still wants to support earlier versions.
Code:
# pulls in translation files for _() strings
try:
    load_translations()
except:
    pass # load_translations() added in calibre 1.9
Quote:
Originally Posted by kovidgoyal View Post
2. Plugin names should never be translated, action_spec should contain translated strings, those are what is displayed ot the user.
Okay. I see that the InterfaceActionBase.name parameter has be left untranslated for calibre to match up with the right plugin on the website. That (untranslated) plugin name is shown in to the user in Preferences -> Plugins and Get Plugins lists.

The description on the Preferences -> Plugins comes from InterfaceActionBase.description and can be translated. But the desc on the Get Plugins list isn't. I assume it--and the name--are coming from a web server with the plugin list.

I don't expect anything to be done about this right now, I just wanted to clarify that there are places the user will see the untranslated name.
JimmXinu is offline   Reply With Quote