Include placeholder in numfig prefix i18n strings so that they do not end in spaces

This commit is contained in:
Georg Brandl 2014-10-06 15:34:42 +02:00
parent 1bfb881139
commit cd4437122b
3 changed files with 14 additions and 11 deletions

View File

@ -72,9 +72,9 @@ class Config(object):
nitpick_ignore = ([], 'html'), nitpick_ignore = ([], 'html'),
numfig = (False, 'env'), numfig = (False, 'env'),
numfig_secnum_depth = (1, 'env'), numfig_secnum_depth = (1, 'env'),
numfig_prefix = ({'figure': l_('Fig. '), numfig_prefix = ({'figure': l_('Fig. %s'),
'table': l_('Table '), 'table': l_('Table %s'),
'code-block': l_('Listing ')}, 'code-block': l_('Listing %s')},
'env'), 'env'),
# HTML options # HTML options

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Sphinx 1.3a0\n" "Project-Id-Version: Sphinx 1.3a0\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2014-10-06 15:20+0200\n" "POT-Creation-Date: 2014-10-06 15:34+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,15 +18,18 @@ msgstr ""
"Generated-By: Babel 1.3\n" "Generated-By: Babel 1.3\n"
#: sphinx/config.py:75 #: sphinx/config.py:75
msgid "Fig. " #, python-format
msgid "Fig. %s"
msgstr "" msgstr ""
#: sphinx/config.py:76 #: sphinx/config.py:76
msgid "Table " #, python-format
msgid "Table %s"
msgstr "" msgstr ""
#: sphinx/config.py:77 #: sphinx/config.py:77
msgid "Listing " #, python-format
msgid "Listing %s"
msgstr "" msgstr ""
#: sphinx/config.py:84 #: sphinx/config.py:84
@ -34,17 +37,17 @@ msgstr ""
msgid "%s %s documentation" msgid "%s %s documentation"
msgstr "" msgstr ""
#: sphinx/environment.py:1824 #: sphinx/environment.py:1825
#, python-format #, python-format
msgid "see %s" msgid "see %s"
msgstr "" msgstr ""
#: sphinx/environment.py:1827 #: sphinx/environment.py:1828
#, python-format #, python-format
msgid "see also %s" msgid "see also %s"
msgstr "" msgstr ""
#: sphinx/environment.py:1883 #: sphinx/environment.py:1884
msgid "Symbols" msgid "Symbols"
msgstr "" msgstr ""

View File

@ -251,7 +251,7 @@ class HTMLTranslator(BaseTranslator):
self.body.append(self.starttag(node, 'span', '', CLASS='caption-number')) self.body.append(self.starttag(node, 'span', '', CLASS='caption-number'))
prefix = self.builder.config.numfig_prefix.get(figtype, '') prefix = self.builder.config.numfig_prefix.get(figtype, '')
numbers = self.builder.fignumbers[figtype][figure_id] numbers = self.builder.fignumbers[figtype][figure_id]
self.body.append(prefix + '.'.join(map(str, numbers)) + " ") self.body.append(prefix % '.'.join(map(str, numbers)) + ' ')
self.body.append('</span>') self.body.append('</span>')
if isinstance(node.parent, nodes.figure): if isinstance(node.parent, nodes.figure):