Development Translation - gazpachoking/deluge GitHub Wiki
To help translate Deluge please register at the Launchpad translation site
To mark text for translation in Python and ExtJS wrap the string with the function _() like this:
torrent.set_tracker_status(_("Announce OK"))
For GTK you can move the translation out of the code and into the glade files:
<property name="label" translatable="yes">Max Upload Speed:</property>
For more details see: Python Gettext
These are the overall stages in gettext translation: POT (Portable Object Template) files -> _ PO (Portable Object) files_ -> MO (Machine Object) files
-
potfiles.increated withcreate_potfiles_in.py -
deluge.potcreated withgettextize.sh - Upload
deluge.potlocated indeluge/i18n/to translation site - Wait for the translators to translate the text.
- Download the updated
POfiles for each language from the translation site, extract todeluge/i18n/and strip thedeluge-prefix:
brfor i in deluge-*.po; do j=echo $i | cut -d - -f2; cp $i $j; rm $i; done - The binary
MOfiles for each language are generated insetup.pyby using themsgfmt.pyscript.
To enable WebUI to use translations update gettext.js by running gen_gettext.py script.
- podiff - Compare textual information in two PO files
- gtranslator - GUI po file editor
- Poedit - GUI po file editor
Verification that translations are working correctly can be performed by running deluge like this:
If you do not have a particular language installed on your system it will only translate based on the binary MO files for Deluge so some GTK text strings will remain in English.
LANGUAGE=fr deluge
LANGUAGE=ru_RU.UTF-8 deluge