~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/export_pot.py

  • Committer: Jelmer Vernooij
  • Date: 2011-09-26 11:00:20 UTC
  • mfrom: (6167 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6169.
  • Revision ID: jelmer@samba.org-20110926110020-g86tgisgnuajlc2n
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    errors,
29
29
    help_topics,
30
30
    plugin,
 
31
    help,
31
32
    )
32
33
from bzrlib.trace import (
33
34
    mutter,
34
35
    note,
35
36
    )
 
37
from bzrlib.i18n import gettext
36
38
 
37
39
 
38
40
def _escape(s):
118
120
        if getattr(opt, 'title', None):
119
121
            lineno = offsets.get(opt.title, 9999)
120
122
            if lineno == 9999:
121
 
                note("%r is not found in bzrlib/option.py" % opt.title)
 
123
                note(gettext("%r is not found in bzrlib/option.py") % opt.title)
122
124
            _poentry(outf, path, lineno, opt.title,
123
125
                     'title of %r option' % name)
124
126
        if getattr(opt, 'help', None):
125
127
            lineno = offsets.get(opt.help, 9999)
126
128
            if lineno == 9999:
127
 
                note("%r is not found in bzrlib/option.py" % opt.help)
 
129
                note(gettext("%r is not found in bzrlib/option.py") % opt.help)
128
130
            _poentry(outf, path, lineno, opt.help,
129
131
                     'help of %r option' % name)
130
132
 
180
182
        command = _mod_commands.get_cmd_object(cmd_name, False)
181
183
        if command.hidden:
182
184
            continue
183
 
        note("Exporting messages from builtin command: %s", cmd_name)
 
185
        note(gettext("Exporting messages from builtin command: %s"), cmd_name)
184
186
        _write_command_help(outf, command)
185
187
 
186
188
    plugin_path = plugin.get_core_plugin_path()
196
198
            # skip non-core plugins
197
199
            # TODO: Support extracting from third party plugins.
198
200
            continue
199
 
        note("Exporting messages from plugin command: %s in %s",
200
 
             cmd_name, command.plugin_name())
 
201
        note(gettext("Exporting messages from plugin command: {0} in {1}").format(
 
202
             cmd_name, command.plugin_name() ))
201
203
        _write_command_help(outf, command)
202
204
 
203
205
 
221
223
            continue
222
224
        fmt = getattr(klass, "_fmt", None)
223
225
        if fmt:
224
 
            note("Exporting message from error: %s", name)
 
226
            note(gettext("Exporting message from error: %s"), name)
225
227
            _poentry(outf, 'bzrlib/errors.py',
226
228
                     offsets.get(fmt, 9999), fmt)
227
229
 
234
236
                    outf,
235
237
                    'dummy/help_topics/'+key+'/detail.txt',
236
238
                    1, doc)
237
 
 
 
239
        elif callable(doc): # help topics from files
 
240
            _poentry_per_paragraph(
 
241
                    outf,
 
242
                    'en/help_topics/'+key+'.txt',
 
243
                    1, doc(key))
238
244
        summary = topic_registry.get_summary(key)
239
245
        if summary is not None:
240
246
            _poentry(outf, 'dummy/help_topics/'+key+'/summary.txt',
246
252
    _standard_options(outf)
247
253
    _command_helps(outf)
248
254
    _error_messages(outf)
249
 
    # disable exporting help topics until we decide  how to translate it.
250
 
    #_help_topics(outf)
 
255
    _help_topics(outf)