From 2f18794ce83eb0844c29a6a523475d5b71f8b372 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Tue, 3 Apr 2018 22:40:27 +0200 Subject: [PATCH] Tr also has daemon mode check without testmode check --- src/tr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tr.py b/src/tr.py index cf7f16ac..cdf2db8a 100644 --- a/src/tr.py +++ b/src/tr.py @@ -1,6 +1,7 @@ import os import shared +import state # This is used so that the translateText function can be used when we are in daemon mode and not using any QT functions. class translateClass: @@ -18,7 +19,7 @@ def _translate(context, text, disambiguation = None, encoding = None, n = None): def translateText(context, text, n = None): try: - is_daemon = shared.thisapp.daemon + is_daemon = shared.thisapp.daemon or state.testmode except AttributeError: # inside the plugin is_daemon = False if not is_daemon: