fr:develop:collaboration:dev:translation

Differences

This shows you the differences between two versions of the page.

fr:develop:collaboration:dev:translation [2021/04/22 09:52] qroyerfr:develop:collaboration:dev:translation [2021/09/28 16:17] () qroyer
 10:  10:
 ==== Traduire des champs dans des classes Qt ==== ==== Traduire des champs dans des classes Qt ====
  
-    self.tr(‘string to translate’)+  self.tr(‘string to translate’)
  
 ==== Traduire des champs en dehors des classes Qt ==== ==== Traduire des champs en dehors des classes Qt ====
 16:  16:
 Si pas de classe ou heritage de classe qui pose problème :  Si pas de classe ou heritage de classe qui pose problème : 
  
-    from PyQt5.QtCore import QCoreApplication +  from PyQt5.QtCore import QCoreApplication 
-    text = QCoreApplication.translate(‘Input’, ‘string to translate’) # ‘Input’ sera le nom de la ‘fausse’ classe dans QLinguist et ‘Neglect’ le string à traduire.+  text = QCoreApplication.translate(‘Input’, ‘string to translate’) # ‘Input’ sera le nom de la ‘fausse’ classe dans QLinguist et ‘Neglect’ le string à traduire.
  
 Ou Ou
-    app = QApplication(sys.argv) +  app = QApplication(sys.argv) 
-    languageTranslator = QTranslator(app) +  languageTranslator = QTranslator(app) 
-    if language == 0: +  if language == 0: 
-        input_file_translation = 'Zen_EN' +      input_file_translation = 'Zen_EN' 
-        languageTranslator.load(input_file_translation, os.path.join(os.getcwd(), 'translation')) +      languageTranslator.load(input_file_translation, os.path.join(os.getcwd(), 'translation')) 
-    if language == 1: +  if language == 1: 
-        input_file_translation = 'Zen_FR' +      input_file_translation = 'Zen_FR' 
-        languageTranslator.load(input_file_translation, os.path.join(os.getcwd(), 'translation')) +      languageTranslator.load(input_file_translation, os.path.join(os.getcwd(), 'translation')) 
-    elif language == 2: +  elif language == 2: 
-        input_file_translation = 'Zen_ES' +      input_file_translation = 'Zen_ES' 
-        languageTranslator.load(input_file_translation, os.path.join(os.getcwd(), 'translation')) +      languageTranslator.load(input_file_translation, os.path.join(os.getcwd(), 'translation')) 
-    app.installTranslator(languageTranslator) +  app.installTranslator(languageTranslator) 
-    app.translate(‘Input’, ‘string to translate’)+  app.translate(‘Input’, ‘string to translate’)
  
 ===== Mise à jour des fichiers .ts à traduire dans HABBY ===== ===== Mise à jour des fichiers .ts à traduire dans HABBY =====
 50:  50:
  
   * Relancer HABBY   * Relancer HABBY
 +
 +{{indexmenu_n>4}}
  • fr/develop/collaboration/dev/translation.1619077968.txt.gz
  • 2021/04/22 09:52
  • qroyer