Require msgcat before initialising ttkbootstrap
This commit is contained in:
@@ -30,6 +30,11 @@ class ThemeMixin:
|
|||||||
def init_theme(self) -> None:
|
def init_theme(self) -> None:
|
||||||
"""Initialise ttk style handling and apply the detected theme."""
|
"""Initialise ttk style handling and apply the detected theme."""
|
||||||
if HAS_TTKBOOTSTRAP:
|
if HAS_TTKBOOTSTRAP:
|
||||||
|
try:
|
||||||
|
# Ensure msgcat package is available before ttkbootstrap initialises translations
|
||||||
|
self.root.tk.call("package", "require", "msgcat") # type: ignore[attr-defined]
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
self.style = tb.Style()
|
self.style = tb.Style()
|
||||||
self.using_tb = True
|
self.using_tb = True
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user