Require msgcat before initialising ttkbootstrap
This commit is contained in:
parent
317220c290
commit
3aa0d7c5b4
|
|
@ -30,6 +30,11 @@ class ThemeMixin:
|
|||
def init_theme(self) -> None:
|
||||
"""Initialise ttk style handling and apply the detected theme."""
|
||||
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.using_tb = True
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in New Issue