py3: Draft: python3 translate
This commit is contained in:
@@ -78,11 +78,17 @@ try:
|
||||
_encoding = QtGui.QApplication.UnicodeUTF8
|
||||
def translate(context, text):
|
||||
"convenience function for Qt translator"
|
||||
return QtGui.QApplication.translate(context, text, None, _encoding).encode("utf8")
|
||||
if sys.version_info.major >= 3:
|
||||
return QtGui.QApplication.translate(context, text, None, _encoding)
|
||||
else:
|
||||
return QtGui.QApplication.translate(context, text, None, _encoding).encode("utf8")
|
||||
except AttributeError:
|
||||
def translate(context, text):
|
||||
"convenience function for Qt translator"
|
||||
return QtGui.QApplication.translate(context, text, None).encode("utf8")
|
||||
if sys.version >= 3:
|
||||
return QtGui.QApplication.translate(context, text, None)
|
||||
else:
|
||||
return QtGui.QApplication.translate(context, text, None).encode("utf8")
|
||||
|
||||
def msg(text=None,mode=None):
|
||||
"prints the given message on the FreeCAD status bar"
|
||||
|
||||
Reference in New Issue
Block a user