Skip to content

Commit

Permalink
Fix gettext extraction by using a fresh build env in term_tolltips ext
Browse files Browse the repository at this point in the history
  • Loading branch information
n-peugnet committed Sep 1, 2024
1 parent e1872b6 commit 17df453
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion _ext/term_tooltips.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from sphinx.application import Sphinx
from sphinx.builders.dummy import DummyBuilder
from sphinx.domains.std import StandardDomain
from sphinx.environment import BuildEnvironment
from sphinx.util.docutils import new_document
from sphinx.writers.html5 import HTML5Translator
from sphinx.writers.text import TextTranslator, TextWriter
Expand Down Expand Up @@ -58,7 +59,8 @@ class TermTooltips(SphinxPostTransform):

def __init__(self, document: nodes.document, startnode: nodes.Node | None = None):
super().__init__(document, startnode)
self.writer = TextWriter(TooltipBuilder(self.app, self.env)) # type: ignore
builder = TooltipBuilder(self.app, BuildEnvironment(self.app))
self.writer = TextWriter(builder) # type: ignore

def run(self) -> None:
if self.app.builder.format != 'html':
Expand Down

0 comments on commit 17df453

Please sign in to comment.