This repository has been archived on 2024-12-03. You can view files and clone it, but cannot push or open issues or pull requests.
PyBitmessage-2024-12-03/src/tr.py
2024-05-29 21:39:16 +09:00

27 lines
517 B
Python

"""
Slim layer providing environment agnostic _translate()
"""
from unqstr import ustr
try:
import state
except ImportError:
from . import state
def _tr_dummy(context, text, disambiguation=None, n=None):
# pylint: disable=unused-argument
return text
if state.enableGUI and not state.curses:
try:
from qtpy import QtWidgets, QtCore
except ImportError:
_translate = _tr_dummy
else:
_translate = QtWidgets.QApplication.translate
else:
_translate = _tr_dummy