Changes between Version 12 and Version 13 of CookBook/PluginL10N
- Timestamp:
- May 10, 2010, 12:18:46 AM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CookBook/PluginL10N
v12 v13 73 73 from api import _, tag_, N_ 74 74 }}} 75 76 75 77 76 ==== Preset configuration for i18n/l10n helper programs ==== … … 108 107 This will tell the i18n/l10n helper programs where to look for and store message catalog files. 109 108 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 }}} 109 In 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 111 The `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. 118 112 119 113 ==== Mark text for extraction ==== … … 161 155 162 156 ==== Summing it up ==== 163 164 157 Here'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]. 165 158 … … 168 161 - 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) 169 162 163 You'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 170 165 === Do translators work === 171 166 General 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. … … 195 190 196 191 Now 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 193 If 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. 197 194 198 195 === Compile and use it ===