Quote:
Originally Posted by kovidgoyal
I have added the infrastructure to calibre...
|
Excellent.
Quote:
Originally Posted by kovidgoyal
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
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.