This repository has been archived on 2024-12-19. You can view files and clone it, but cannot push or open issues or pull requests.
PyBitmessage-2024-12-19/src/tr.py

22 lines
615 B
Python
Raw Normal View History

import shared
def _translate(context, text, disambiguation=None, n=None):
return translateText(context, text, n)
def translateText(context, text, n=None):
try:
is_daemon = shared.thisapp.daemon
except AttributeError: # inside the plugin
is_daemon = False
if not is_daemon:
from qtpy import QtWidgets, QtCore
if n is None:
return QtWidgets.QApplication.translate(context, text)
else:
return QtWidgets.QApplication.translate(
context, text, None, QtCore.QCoreApplication.CodecForTr, n)
else:
return text