Show More
@@ -70,7 +70,7 b' def topicmatch(kw):' | |||
|
70 | 70 | """ |
|
71 | 71 | kw = encoding.lower(kw) |
|
72 | 72 | def lowercontains(container): |
|
73 |
return kw in encoding.lower( |
|
|
73 | return kw in encoding.lower(container) # translated in helptable | |
|
74 | 74 | results = {'topics': [], |
|
75 | 75 | 'commands': [], |
|
76 | 76 | 'extensions': [], |
@@ -89,9 +89,10 b' def topicmatch(kw):' | |||
|
89 | 89 | summary = entry[2] |
|
90 | 90 | else: |
|
91 | 91 | summary = '' |
|
92 | docs = getattr(entry[0], '__doc__', None) or '' | |
|
92 | # translate docs *before* searching there | |
|
93 | docs = _(getattr(entry[0], '__doc__', None)) or '' | |
|
93 | 94 | if kw in cmd or lowercontains(summary) or lowercontains(docs): |
|
94 |
doclines = |
|
|
95 | doclines = docs.splitlines() | |
|
95 | 96 | if doclines: |
|
96 | 97 | summary = doclines[0] |
|
97 | 98 | cmdname = cmd.split('|')[0].lstrip('^') |
@@ -102,7 +103,8 b' def topicmatch(kw):' | |||
|
102 | 103 | # extensions.load ignores the UI argument |
|
103 | 104 | mod = extensions.load(None, name, '') |
|
104 | 105 | if lowercontains(name) or lowercontains(docs): |
|
105 | results['extensions'].append((name, _(docs).splitlines()[0])) | |
|
106 | # extension docs are already translated | |
|
107 | results['extensions'].append((name, docs.splitlines()[0])) | |
|
106 | 108 | for cmd, entry in getattr(mod, 'cmdtable', {}).iteritems(): |
|
107 | 109 | if kw in cmd or (len(entry) > 2 and lowercontains(entry[2])): |
|
108 | 110 | cmdname = cmd.split('|')[0].lstrip('^') |
General Comments 0
You need to be logged in to leave comments.
Login now