diff --git a/Documentation/sphinx/translations.py b/Documentation/sphinx/translations.py index 5f2866a12533..99a73075697a 100644 --- a/Documentation/sphinx/translations.py +++ b/Documentation/sphinx/translations.py @@ -36,9 +36,6 @@ class TranslationsTransform(Transform): def apply(self): app = self.document.settings.env.app - if app.builder.format not in ['html']: - return - docname = self.document.settings.env.docname this_lang_code = None @@ -70,6 +67,10 @@ class TranslationsTransform(Transform): def process_languages(app, doctree, docname): for node in doctree.traverse(LanguagesNode): + if app.builder.format not in ['html']: + node.parent.remove(node) + continue + languages = [] # Iterate over the child nodes; any resolved links will have