Doc - Fix entity warnings when no language tag was specified
@@ -211,8 +211,16 @@ def process_entity_nodes(app, doctree, docname):
entities = AllEntities.install(env)
entities.resolve_pendings(app)
+ language = None
+ try:
language = next(l for l in LANGUAGES if l in app.tags)
+ except Exception:
+ logger.warning(f"No language tag specified, not resolving entities in {docname}")
+
for node in doctree.traverse(EntityNode):
+ if language is None:
+ node.replace_self(nodes.Text(_(node.entity), _(node.entity)))
+ else:
entity = entities.get(language, node.entity, docname)
if entity is None:
node.replace_self(nodes.Text(_(node.entity), _(node.entity)))
