Changes between Initial Version and Version 1 of Development/Translation


Ignore:
Timestamp:
11/29/2011 11:54:58 PM (10 years ago)
Author:
Cas
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Development/Translation

    v1 v1  
     1= Translation = 
     2 
     3== Marking Text for Translation == 
     4 
     5To mark text for translation wrap the string with the function `_()` like this: 
     6{{{ 
     7torrent.set_tracker_status(_("Announce OK")) 
     8}}} 
     9 
     10For GTK you can move the translation out of the code and into the `glade` files:  
     11{{{ 
     12<property name="label" translatable="yes">Max Upload Speed:</property> 
     13}}} 
     14 
     15For more detail see: [http://docs.python.org/library/gettext.html Python Gettext] 
     16 
     17== Translation Process == 
     18 
     19These are the overall stages in gettext translation: ''POT (Portable Object Template) files'' `->` '' PO (Portable Object) files'' `->` ''MO (Machine Object) files''  
     20 
     21 * `potfiles.in` created with `create_potfiles_in.py` 
     22 * `deluge.pot` created with `gettextize.sh` 
     23 * Upload `deluge.pot` located in `deluge/i18n/` to [https://translations.launchpad.net/deluge/trunk/ translation site] 
     24 * Wait for the translators to translate the text. 
     25 * Retrieve the updated `PO` files for each langauge from the translation site and extract to `deluge/i18n/` 
     26 * The binary `MO` files for each language are generated in `setup.py` by using the `msgfmt.py` script. 
     27 
     28 
     29== Testing Translation == 
     30 
     31Verification that translations are working correctly can be performed by running deluge like this: 
     32 
     33If you do not have a particular language installed on your system it will only tranlate based on the binary MO files for Deluge so some GTK text strings will remain in English.  
     34 
     35{{{ 
     36LANGUAGE=fr deluge 
     37LANGUAGE=ru_RU.UTF-8 deluge 
     38}}}