198 | | |
| 198 | Note: Trac 1.0 added support for a special kind of `N_` marker, `cleandoc_`, which can be used to reformat multiline messages in a compact form. There's also support to apply this "cleandoc" transformation to the documentation of instances of `trac.config.Option` and its subclasses. However, this support is coming from a special Python extractor which has to be used instead of the default Python extractor from Babel. |
| 199 | |
| 200 | The additional change is: |
| 201 | {{{#!diff |
| 202 | Index: setup.py |
| 203 | =================================================================== |
| 204 | --- setup.py (revision 11363) |
| 205 | +++ setup.py (working copy) |
| 206 | @@ -24,7 +24,7 @@ |
| 207 | if cmdclass: |
| 208 | extra['cmdclass'] = cmdclass |
| 209 | extractors = [ |
| 210 | - ('**.py', 'python', None), |
| 211 | + ('**.py', 'trac.dist:extract_python', None), |
| 212 | ('**/templates/**.html', 'genshi', None) |
| 213 | ] |
| 214 | extra['message_extractors'] = { |
| 215 | |
| 216 | }}} |
| 217 | |
| 218 | The default `cleanup_keywords` (the `Option` subclasses) are not automatically `keywords` however. The corresponding option for the `extract_messages` section of the `setup.cfg` file should therefore contain the `cleandoc_` token, or the various `Config` subclasses together with the position of the doc argument in that subclass. |
| 219 | As a (somewhat complex) example, see the following excerpt from Trac's [source:tags/trac-1.0/setup.cfg setup.cfg] file: |
| 220 | {{{#!python |
| 221 | [extract_messages_tracini] |
| 222 | add_comments = TRANSLATOR: |
| 223 | copyright_holder = Edgewall Software |
| 224 | msgid_bugs_address = trac-dev@googlegroups.com |
| 225 | output_file = trac/locale/tracini.pot |
| 226 | keywords = ConfigSection:2 Option:4 BoolOption:4 IntOption:4 FloatOption:4 ListOption:6 ChoiceOption:4 PathOption:4 ExtensionOption:5 OrderedExtensionsOption:6 |
| 227 | no-default-keywords = yes |
| 228 | mapping_file = tracini.cfg |
| 229 | }}} |