Changes between Version 11 and Version 12 of CookBook/PluginL10N
- Timestamp:
- May 9, 2010, 7:18:57 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CookBook/PluginL10N
v11 v12 136 136 ==== Register message catalog files for packaging ==== 137 137 To 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.py140 --- a/ foo/setup.py141 +++ b/ foo/setup.py142 @@ -39,6 +39, 8@@138 {{{#!diff 139 diff -u a/setup.py b/setup.py 140 --- a/setup.py 141 +++ b/setup.py 142 @@ -39,6 +39,7 @@ 143 143 package_data = { 144 'foo': [144 <path>: [ 145 145 'htdocs/css/*.css', 146 + 'locale/*.*', 147 + 'locale/*/LC_MESSAGES/*.*', 146 + 'locale/*/LC_MESSAGES/*.mo', 148 147 ], 149 148 }, … … 160 159 161 160 All 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 164 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 166 Note: 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) 162 169 163 170 === Do translators work ===