From: pascale.noyret Date: Mon, 15 May 2017 08:50:50 +0000 (+0200) Subject: ajout debug pour print X-Git-Tag: V8_3_0~17 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c947d46b22b6ea1614bb7534ff6eb1ba83b3d964;p=tools%2Feficas.git ajout debug pour print --- diff --git a/Extensions/localisation.py b/Extensions/localisation.py index 41736cfe..e934fd8c 100644 --- a/Extensions/localisation.py +++ b/Extensions/localisation.py @@ -27,7 +27,7 @@ from PyQt5.QtCore import QTranslator code_translator = QTranslator() eficas_translator = QTranslator() -def localise(application, locale=None,file=None,translatorFichier=None ): +def localise(application, locale=None,file=None,translatorFichier=None, debug=False ): """ """ from PyQt5.QtCore import QLibraryInfo @@ -41,13 +41,13 @@ def localise(application, locale=None,file=None,translatorFichier=None ): if locale=="ang" : locale="en" - if file != None : + if file != None and debug : print ('chargement de ', file,monPath) print (eficas_translator.load(file,monPath)) print (QApplication.installTranslator(eficas_translator)) elif eficas_translator.load("eficas_" + locale, monPath): QApplication.installTranslator(eficas_translator) - else: + elif debug: print ("Unable to load Eficas translator!") global code_translator @@ -56,9 +56,9 @@ def localise(application, locale=None,file=None,translatorFichier=None ): print (translatorFichier, ' loaded') elif (code_translator.load(translatorFichier+'_'+locale)): print(translatorFichier+'_'+locale+ ' loaded') - else : + elif debug : print ("Unable to load Code translator! No file or No translation" + translatorFichier) - print (QApplication.installTranslator(code_translator)) + if debug : print (QApplication.installTranslator(code_translator)) if __name__ == "__main__":