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