From 9bd36d746608706e5b089f3d1f009488201cb0a3 Mon Sep 17 00:00:00 2001 From: Sebastien Jourdain Date: Wed, 10 Jun 2026 14:42:08 -0600 Subject: [PATCH] fix(translation): set state defaults on 'with' exit --- trame_client/widgets/core.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/trame_client/widgets/core.py b/trame_client/widgets/core.py index d0aaba3..7958115 100644 --- a/trame_client/widgets/core.py +++ b/trame_client/widgets/core.py @@ -1,9 +1,10 @@ -import sys import logging +import sys + +from trame_common.obj.component import TrameComponent from trame_client.utils.defaults import TrameDefault from trame_client.utils.formatter import to_pretty_html -from trame_common.obj.component import TrameComponent AVAILABLE_DIRECTIVES = [ ("v_text", "v-text"), @@ -795,6 +796,9 @@ def __enter__(self): def __exit__(self, exc_type, exc_value, exc_traceback): HTML_CTX.exit(self) + # flush defaults to state to enable valid translation + self.html + class HtmlElement(AbstractElement): MODULE = None