diff --git a/qt/aqt/utils.py b/qt/aqt/utils.py index b01cc7442..74d07ab32 100644 --- a/qt/aqt/utils.py +++ b/qt/aqt/utils.py @@ -34,7 +34,10 @@ def locale_dir() -> str: def tr(group: StringsGroup, key: str, **kwargs: Union[str, int, float]) -> str: """Shortcut to access translations from the backend. (Currently) requires an open collection.""" - return aqt.mw.col.backend.translate(group, key, **kwargs) + if aqt.mw.col: + return aqt.mw.col.backend.translate(group, key, **kwargs) + else: + return key def openHelp(section):