mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix translation lookup and propagation.
This commit is contained in:
parent
684ecc2678
commit
4b8249e6b1
@ -736,7 +736,8 @@ class BuildEnvironment:
|
||||
self.dependencies.setdefault(self.docname, set()).add(filename)
|
||||
|
||||
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)
|
||||
if not has_trans:
|
||||
return None
|
||||
@ -764,7 +765,7 @@ class BuildEnvironment:
|
||||
for node, msg in extract_messages(doctree):
|
||||
ctx = node.parent
|
||||
patch = new_document(source, settings)
|
||||
msgstr = translation.gettext(msg)
|
||||
msgstr = translation.ugettext(msg)
|
||||
parser.parse(msgstr, patch)
|
||||
ctx.replace(node, patch.children)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user