Merge pull request #421 from dev-at-stellardeath-org/master

Fix non-GUI usage in BOPTools
This commit is contained in:
wwmayer 2017-01-08 18:48:14 +01:00 committed by GitHub
commit 5a370d6a78

View File

@ -37,16 +37,16 @@ if FreeCAD.GuiUp:
#-------------------------- translation-related code ----------------------------------------
#(see forum thread "A new Part tool is being born... JoinFeatures!"
#http://forum.freecadweb.org/viewtopic.php?f=22&t=11112&start=30#p90239 )
try:
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Exception:
except Exception:
def _fromUtf8(s):
return s
try:
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
#--------------------------/translation-related code ----------------------------------------