mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
fix #1056: message "Return value: ..." generated by refcounting not localized
This commit is contained in:
@@ -17,6 +17,7 @@ from os import path
|
|||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
|
|
||||||
from sphinx import addnodes
|
from sphinx import addnodes
|
||||||
|
from sphinx.locale import _
|
||||||
|
|
||||||
|
|
||||||
# refcount annotation
|
# refcount annotation
|
||||||
@@ -78,12 +79,14 @@ class Refcounts(dict):
|
|||||||
continue
|
continue
|
||||||
elif entry.result_type not in ("PyObject*", "PyVarObject*"):
|
elif entry.result_type not in ("PyObject*", "PyVarObject*"):
|
||||||
continue
|
continue
|
||||||
rc = 'Return value: '
|
rc = _('Return value: ')
|
||||||
if entry.result_refs is None:
|
if entry.result_refs is None:
|
||||||
rc += "Always NULL."
|
rc += _("Always NULL.")
|
||||||
else:
|
else:
|
||||||
rc += (entry.result_refs and "New" or "Borrowed") + \
|
if entry.result_refs:
|
||||||
" reference."
|
rc += _("New reference.")
|
||||||
|
else:
|
||||||
|
rc += _("Borrowed reference.")
|
||||||
node.insert(0, refcount(rc, rc))
|
node.insert(0, refcount(rc, rc))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user