Edgewall Software

Changes between Version 23 and Version 24 of CookBook/PluginL10N


Ignore:
Timestamp:
Sep 25, 2012, 11:03:12 PM (12 years ago)
Author:
Christian Boos
Comment:

document #9666 a bit

Legend:

Unmodified
Added
Removed
Modified
  • CookBook/PluginL10N

    v23 v24  
    196196}}}
    197197
    198 
     198Note: 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
     200The additional change is:
     201{{{#!diff
     202Index: 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
     218The 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.
     219As 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]
     222add_comments = TRANSLATOR:
     223copyright_holder = Edgewall Software
     224msgid_bugs_address = trac-dev@googlegroups.com
     225output_file = trac/locale/tracini.pot
     226keywords = ConfigSection:2 Option:4 BoolOption:4 IntOption:4 FloatOption:4 ListOption:6 ChoiceOption:4 PathOption:4 ExtensionOption:5 OrderedExtensionsOption:6
     227no-default-keywords = yes
     228mapping_file = tracini.cfg
     229}}}
    199230
    200231==== Text extraction from Javascript code ==== #Javascript