= Translation = == Translators == To help translate Deluge please register at the Launchpad [https://translations.launchpad.net/deluge/ translation site] == Marking Text for Translation == 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: {{{ Max Upload Speed: }}} For more details see: [http://docs.python.org/library/gettext.html Python Gettext] == Translation Process == These are the overall stages in gettext translation: ''POT (Portable Object Template) files'' `->` '' PO (Portable Object) files'' `->` ''MO (Machine Object) files'' * `potfiles.in` is created using `create_potfiles_in.py`. * `deluge.pot` is created using `gettextize.sh`. * Upload `deluge/i18n/deluge.pot` to [https://translations.launchpad.net/deluge/ Translation site] * Wait for the translators to translate the text. * Download the updated `PO` files from translation site, extract to `deluge/i18n/` and strip the `deluge-` prefix: {{{rename -f 's/^deluge-//' deluge-*.po}}} * The binary `MO` files for each language are generated in `setup.py` by using the `msgfmt.py` script. To enable WebUI to use translations update `gettext.js` by running `gen_gettext.py` script. == Useful Applications == * [http://puszcza.gnu.org.ua/projects/podiff/ podiff] - Compare textual information in two PO files * [http://projects.gnome.org/gtranslator/ gtranslator] - GUI po file editor * [http://www.poedit.net/ Poedit] - GUI po file editor == Testing Translation == Verification that translations are working correctly can be performed by running deluge as follows. Create an `MO` for a single language in the correct sub-directory: {{{ mkdir -p deluge/i18n/fr/LC_MESSAGES python msgfmt.py -o deluge/i18n/fr/LC_MESSAGES/deluge.mo deluge/i18n/fr.po }}} Run Deluge using an alternative language: {{{ LANGUAGE=fr deluge LANGUAGE=ru_RU.UTF-8 deluge }}} Note: If you do not have a particular language installed on your system it will only translate based on the `MO` files for Deluge so some GTK text/button strings will remain in English.