From c2cfff2a2e9b3fabb9a2f637491a5a1ab912ba0e Mon Sep 17 00:00:00 2001 From: DivineOmega Date: Fri, 21 Jun 2013 13:55:09 +0100 Subject: [PATCH] Reworked translate function to be more accommodating --- src/bitmessagemain.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 1ced22ac..e6bd90eb 100644 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -4058,27 +4058,18 @@ if __name__ == "__main__": print 'Error message:', err os._exit(0) - try: - _encoding = QtGui.QApplication.UnicodeUTF8 - def _translate(context, text): # A non-QT version of _translate is defined below. - return QtGui.QApplication.translate(context, text) - except Exception as err: - print 'Error:', err - import bitmessageqt bitmessageqt.run() else: - def _translate(context, text): # A QT version of _translate is defined above. - if '%' in text: - return translateClass(context, text.replace('%','',1)) - else: - return text shared.printLock.acquire() print 'Running as a daemon. You can use Ctrl+C to exit.' shared.printLock.release() while True: time.sleep(20) +def _translate(context, text): + return translateText(context, text) + def translateText(context, text): if not shared.safeConfigGetBoolean('bitmessagesettings', 'daemon'): try: