(context, text, n = None)
| 17 | return translateText(context, text, n) |
| 18 | |
| 19 | def translateText(context, text, n = None): |
| 20 | try: |
| 21 | is_daemon = shared.thisapp.daemon |
| 22 | except AttributeError: # inside the plugin |
| 23 | is_daemon = False |
| 24 | if not is_daemon: |
| 25 | try: |
| 26 | from PyQt4 import QtCore, QtGui |
| 27 | except Exception as err: |
| 28 | print 'PyBitmessage requires PyQt unless you want to run it as a daemon and interact with it using the API. You can download PyQt from http://www.riverbankcomputing.com/software/pyqt/download or by searching Google for \'PyQt Download\'. If you want to run in daemon mode, see https://bitmessage.org/wiki/Daemon' |
| 29 | print 'Error message:', err |
| 30 | os._exit(0) |
| 31 | if n is None: |
| 32 | return QtGui.QApplication.translate(context, text) |
| 33 | else: |
| 34 | return QtGui.QApplication.translate(context, text, None, QtCore.QCoreApplication.CodecForTr, n) |
| 35 | else: |
| 36 | if '%' in text: |
| 37 | return translateClass(context, text.replace('%','',1)) |
| 38 | else: |
| 39 | return text |
no test coverage detected