mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-08-17 16:34:48 -05:00
Fix translation lookup and propagation.
This commit is contained in:
@@ -736,7 +736,8 @@ class BuildEnvironment:
|
|||||||
self.dependencies.setdefault(self.docname, set()).add(filename)
|
self.dependencies.setdefault(self.docname, set()).add(filename)
|
||||||
|
|
||||||
def get_translation(self, section):
|
def get_translation(self, section):
|
||||||
translation, has_trans = init_locale(self.config.locale_dirs,
|
dirs = [path.join(self.srcdir, x) for x in self.config.locale_dirs]
|
||||||
|
translation, has_trans = init_locale(dirs,
|
||||||
self.config.language, section)
|
self.config.language, section)
|
||||||
if not has_trans:
|
if not has_trans:
|
||||||
return None
|
return None
|
||||||
@@ -764,7 +765,7 @@ class BuildEnvironment:
|
|||||||
for node, msg in extract_messages(doctree):
|
for node, msg in extract_messages(doctree):
|
||||||
ctx = node.parent
|
ctx = node.parent
|
||||||
patch = new_document(source, settings)
|
patch = new_document(source, settings)
|
||||||
msgstr = translation.gettext(msg)
|
msgstr = translation.ugettext(msg)
|
||||||
parser.parse(msgstr, patch)
|
parser.parse(msgstr, patch)
|
||||||
ctx.replace(node, patch.children)
|
ctx.replace(node, patch.children)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user