summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-10-06 15:34:42 +0200
committerGeorg Brandl <georg@python.org>2014-10-06 15:34:42 +0200
commit87a6fac8a13328911f6f3615251db52271d08388 (patch)
tree2fa2b7bf3939d0e99f9f10d55b0dc538604e8300
parent7b19715f348edd743f032c059cd60c001254534f (diff)
downloadsphinx-87a6fac8a13328911f6f3615251db52271d08388.tar.gz
Include placeholder in numfig prefix i18n strings so that they do not end in spaces
-rw-r--r--sphinx/config.py6
-rw-r--r--sphinx/locale/sphinx.pot17
-rw-r--r--sphinx/writers/html.py2
3 files changed, 14 insertions, 11 deletions
diff --git a/sphinx/config.py b/sphinx/config.py
index 0e49f087..65146c21 100644
--- a/sphinx/config.py
+++ b/sphinx/config.py
@@ -72,9 +72,9 @@ class Config(object):
nitpick_ignore = ([], 'html'),
numfig = (False, 'env'),
numfig_secnum_depth = (1, 'env'),
- numfig_prefix = ({'figure': l_('Fig. '),
- 'table': l_('Table '),
- 'code-block': l_('Listing ')},
+ numfig_prefix = ({'figure': l_('Fig. %s'),
+ 'table': l_('Table %s'),
+ 'code-block': l_('Listing %s')},
'env'),
# HTML options
diff --git a/sphinx/locale/sphinx.pot b/sphinx/locale/sphinx.pot
index d65ce7d6..e0d51efb 100644
--- a/sphinx/locale/sphinx.pot
+++ b/sphinx/locale/sphinx.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Sphinx 1.3a0\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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,15 +18,18 @@ msgstr ""
"Generated-By: Babel 1.3\n"
#: sphinx/config.py:75
-msgid "Fig. "
+#, python-format
+msgid "Fig. %s"
msgstr ""
#: sphinx/config.py:76
-msgid "Table "
+#, python-format
+msgid "Table %s"
msgstr ""
#: sphinx/config.py:77
-msgid "Listing "
+#, python-format
+msgid "Listing %s"
msgstr ""
#: sphinx/config.py:84
@@ -34,17 +37,17 @@ msgstr ""
msgid "%s %s documentation"
msgstr ""
-#: sphinx/environment.py:1824
+#: sphinx/environment.py:1825
#, python-format
msgid "see %s"
msgstr ""
-#: sphinx/environment.py:1827
+#: sphinx/environment.py:1828
#, python-format
msgid "see also %s"
msgstr ""
-#: sphinx/environment.py:1883
+#: sphinx/environment.py:1884
msgid "Symbols"
msgstr ""
diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py
index cf92fc5e..1d2cff05 100644
--- a/sphinx/writers/html.py
+++ b/sphinx/writers/html.py
@@ -251,7 +251,7 @@ class HTMLTranslator(BaseTranslator):
self.body.append(self.starttag(node, 'span', '', CLASS='caption-number'))
prefix = self.builder.config.numfig_prefix.get(figtype, '')
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>')
if isinstance(node.parent, nodes.figure):