Edgewall Software

Changes between Version 11 and Version 12 of CookBook/PluginL10N


Ignore:
Timestamp:
May 9, 2010, 7:18:57 PM (14 years ago)
Author:
Christian Boos
Comment:

#Summingitup added link to example + talk about setup tool changes r9638

Legend:

Unmodified
Added
Removed
Modified
  • CookBook/PluginL10N

    v11 v12  
    136136==== Register message catalog files for packaging ====
    137137To include the translated messages into the packaged plugin you need to add the path to the catalog files to `package_data` in `setup.py`:
    138 {{{
    139 diff -u a/foo/setup.py b/foo/setup.py
    140 --- a/foo/setup.py
    141 +++ b/foo/setup.py
    142 @@ -39,6 +39,8 @@
     138{{{#!diff
     139diff -u a/setup.py b/setup.py
     140--- a/setup.py
     141+++ b/setup.py
     142@@ -39,6 +39,7 @@
    143143     package_data = {
    144          'foo': [
     144         <path>: [
    145145             'htdocs/css/*.css',
    146 +            'locale/*.*',
    147 +            'locale/*/LC_MESSAGES/*.*',
     146+            'locale/*/LC_MESSAGES/*.mo',
    148147         ],
    149148     },
     
    160159
    161160All the work you did by now will go unnoticed, at least with regard to package naming. To help with identification of the new revision you should bump the plugin's version. This is done by changing the version/revision, typically in `setup.cfg` or `setup.py`. And you may wish to leave a note regarding your i18n work along the copyright notices as well.
     161
     162==== Summing it up ====
     163
     164Here'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
     166Note:
     167 - it uses the old style for the `domain_functions` call. While this is still supported, new code should use the new style shown above, `domain_functions(domain, functions)`
     168 - 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)
    162169
    163170=== Do translators work ===