Follow the behavior described by :confval:primary_domain to display domain object names and use this as the category in Texinfo desc_signatures.

This commit is contained in:
Jonathan Waltman 2011-07-07 01:39:53 -05:00
parent 626a954821
commit 1fde44cbf6

View File

@ -1271,13 +1271,15 @@ class TexinfoTranslator(nodes.NodeVisitor):
if objtype != 'describe': if objtype != 'describe':
for id in node.get('ids'): for id in node.get('ids'):
self.add_anchor(id, node) self.add_anchor(id, node)
# use the localized name for the category # use the full name of the objtype for the category
try: try:
domain = self.builder.env.domains[node.parent['domain']] domain = self.builder.env.domains[node.parent['domain']]
lname = domain.object_types[objtype].lname primary = self.builder.config.primary_domain
name = domain.get_type_name(domain.object_types[objtype],
primary == domain.name)
except KeyError: except KeyError:
lname = objtype name = objtype
category = self.escape_arg(string.capwords(lname)) category = self.escape_arg(string.capwords(name))
self.body.append('\n%s {%s} ' % (self.at_deffnx, category)) self.body.append('\n%s {%s} ' % (self.at_deffnx, category))
self.at_deffnx = '@deffnx' self.at_deffnx = '@deffnx'
def depart_desc_signature(self, node): def depart_desc_signature(self, node):