Edgewall Software

Changes between Version 2 and Version 3 of CookBook/PluginL10N


Ignore:
Timestamp:
May 7, 2010, 12:56:21 PM (14 years ago)
Author:
hasienda <hoff.st@…>
Comment:

added more content - just another step revision

Legend:

Unmodified
Added
Removed
Modified
  • CookBook/PluginL10N

    v2 v3  
    3131a walk-through
    3232
    33 General advice from [wiki:TracL10N TracL10N] on making good translation for Trac in general applies here too.
    34 
    3533=== Preparing the plugin code ===
    3634==== Provide translation configuration ====
    37 add lines to `setup.cfg`, or if it doesn't exist, create it
    38 This will tell the translation helper programs where to look and store message catalog files. Since this is a per plugin translation, you need to customize the code to the plugins name wherever it reads `foo` in the example.
     35Add some lines to `setup.cfg` or, if it doesn't exist by now, create it with the following content:
     36{{{
     37[extract_messages]
     38add_comments = TRANSLATOR:
     39msgid_bugs_address =
     40output_file = foo/locale/messages.pot
     41keywords = _ ngettext:1,2 N_ tag_
     42width = 72
     43
     44[init_catalog]
     45input_file = foo/locale/messages.pot
     46output_dir = foo/locale
     47domain = foo
     48
     49[compile_catalog]
     50directory = foo/locale
     51domain = foo
     52
     53[update_catalog]
     54input_file = foo/locale/messages.pot
     55output_dir = foo/locale
     56domain = foo
     57}}}
     58This will tell the translation helper programs where to look for and store message catalog files. Since this is a per plugin translation you need to change wherever it reads `foo` in the example to the existing plugin directory that is a short form of plugin's name in most cases.
     59
     60In the `extract_messages` section there are other lines you may like to change. Starting with `add_comments` there is the place to announce yourself as the translator by adding your name after the default `TRANSLATOR:` label. To allow for direct feedback regarding your translation add a valid e-mail address or a mailing list dedicated to translation issues to `msgid_bugs_address`.
    3961
    4062==== Mark text for extraction ====
     
    6587
    6688=== Translation work ===
     89General advice from [wiki:TracL10N TracL10N] on making good translation for Trac in general applies here too.
    6790
    6891=== Compilation and testing ===
    6992Compile the `messages.po` catalog file with your translations into a machine readable `messages.mo` file.
     93{{{
     94python ./setup.py compile_catalog -f -l de_DE
     95}}}
     96The argument `-f` is needed to include even the msgid's marked 'fuzzy'. If you have prepared only one translated catalog the final language selection argument `-l` and identifier string are superfluous. But as soon as there are several other translations that you don't care, it will help to select just your work for compilation.
    7097
    71 Now go for the plugin packaging, make the python egg.
     98Now finish your work by packaging the plugin. Make the python egg as usual:
     99{{{
     100python ./setup.py bdist_egg
     101}}}
    72102
    73103=== Advanced stuff ===