Edgewall Software

Changes between Version 12 and Version 13 of CookBook/PluginL10N


Ignore:
Timestamp:
May 10, 2010, 12:18:46 AM (14 years ago)
Author:
hasienda <hoff.st@…>
Comment:

added link to another translation example attached to the page, some editorial changes to cleanup after review

Legend:

Unmodified
Added
Removed
Modified
  • CookBook/PluginL10N

    v12 v13  
    7373from api import _, tag_, N_
    7474}}}
    75 
    7675
    7776==== Preset configuration for i18n/l10n helper programs ====
     
    108107This will tell the i18n/l10n helper programs where to look for and store message catalog files.
    109108
    110 In the `extract_messages` section there are other lines you may like to change.
    111 
    112 // 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`. //
    113  Well, no, add_comments simply list the tags in the comments surrounding the calls to the translation functions in the source code that have to be propagated to the catalogs... (see Babel:wiki:Documentation/0.9/setup.html#extract-messages)
    114 
    115 {{{#!comment
    116 resume review here...
    117 }}}
     109In the `extract_messages` section there is just one more lines you may like to change: `msgid_bugs_address`. To allow for direct feedback regarding your i18n work add a valid e-mail address or a mailing list dedicated to translation issues there.
     110
     111The `add_comments` line simply lists the tags in the comments surrounding the calls to the translation functions in the source code that have to be propagated to the catalogs (see Babel:wiki:Documentation/0.9/setup.html#extract-messages). So you will want to leave that one untouched.
    118112
    119113==== Mark text for extraction ====
     
    161155
    162156==== Summing it up ====
    163 
    164157Here's an example of the changes required to add i18n support to a plugin: [http://github.com/cboos/trachacks-hudsontracplugin/commit/1669cefa806614e62bd9ce5573750e30fa060408 HudsonTrac 0.12 branch].
    165158
     
    168161 - it uses: `<path>/locale/*.*, <path>/locale/*/LC_MESSAGES/*.*` for the `package_data`. You should rather use only `<path>/locale/*/LC_MESSAGES/*.*` (see r9638 and r9640)
    169162
     163You'll find another example attached to this page. That is [th:wiki:SubticketsPlugin Sub-Tickets plugin] v0.1.0 and a [attachment:trac-subtickets-plugin_i18n-l10n.patch diff] containing all i18n/l10n related work to produce a German translation based on that source.
     164
    170165=== Do translators work ===
    171166General advice from [wiki:TracL10N TracL10N] on making good translation for Trac in general applies here too. For those who read previous parts, you do notice that we switch from talking about i18n to 'l10n' now, don't you? No source code mangling. All code below is no meant to become part of the plugin source but meant to be put to the command line.
     
    195190
    196191Now fire up the editor of your choice. There are dedicated message catalog (.po) file editors that ensure for quick results as a beginner as well as make working on large message catalogs with few untranslated texts or translations marked 'fuzzy' much more convenient. See dedicated resources for details on choosing an editor program as well as for help on editing .po files.^4, 5^
     192
     193If not already taken care for by your (PO) editor, the place to announce yourself as the last translator is after the default `TRANSLATOR:` label at top of the message catalog file.
    197194
    198195=== Compile and use it ===