Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| fr:develop:collaboration:dev [2021/03/11 19:08] – qroyer | fr:develop:collaboration:dev [2021/04/27 14:49] (current) – qroyer | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Participer au développement Python d' | ====== Participer au développement Python d' | ||
| - | ===== Github ===== | + | {{namespace> |
| - | https:// | + | {{indexmenu_n> |
| - | ===== Environnement Python ===== | ||
| - | |||
| - | Si besoin, vous trouverez ci-dessous, les étapes pour faciliter la création de l' | ||
| - | |||
| - | ==== Windows ==== | ||
| - | |||
| - | === Dépendances === | ||
| - | |||
| - | * Python >= 3 | ||
| - | * Git | ||
| - | * Microsoft Visual C++ 14.0 : https:// | ||
| - | * GDAL : https:// | ||
| - | |||
| - | === Étape par étape === | ||
| - | |||
| - | * Avoir cloné le projet git https:// | ||
| - | * Télécharger les dépendances décrite ci-dessus. | ||
| - | * Ouvrez le fichier ' | ||
| - | * le chemin d' | ||
| - | * le chemin d' | ||
| - | * sauvegardez le fichier. | ||
| - | * Lancer le fichier ' | ||
| - | * Si toutes les étapes se sont bien déroulées, | ||
| - | * Votre environnement virtuel Python pour HABBY est prêt. | ||
| - | |||
| - | ==== Linux ==== | ||
| - | |||
| - | ==== Mac ==== | ||
| - | |||
| - | |||
| - | ===== Traduction du logiciel ===== | ||
| - | |||
| - | ==== Prés-requis ==== | ||
| - | |||
| - | * Linguist.exe : (https:// | ||
| - | * environnement virtuel d’HABBY avec PyQt5 | ||
| - | |||
| - | ==== Utilisation dans le code ==== | ||
| - | |||
| - | === Traduire des champs dans des classes Qt === | ||
| - | |||
| - | self.tr(‘string to translate’) | ||
| - | |||
| - | === Traduire des champs en dehors des classes Qt === | ||
| - | |||
| - | Si pas de classe ou heritage de classe qui pose problème : | ||
| - | |||
| - | from PyQt5.QtCore import QCoreApplication | ||
| - | text = QCoreApplication.translate(‘Input’, | ||
| - | |||
| - | Ou | ||
| - | app = QApplication(sys.argv) | ||
| - | languageTranslator = QTranslator(app) | ||
| - | if language == 0: | ||
| - | input_file_translation = ' | ||
| - | languageTranslator.load(input_file_translation, | ||
| - | if language == 1: | ||
| - | input_file_translation = ' | ||
| - | languageTranslator.load(input_file_translation, | ||
| - | elif language == 2: | ||
| - | input_file_translation = ' | ||
| - | languageTranslator.load(input_file_translation, | ||
| - | app.installTranslator(languageTranslator) | ||
| - | app.translate(‘Input’, | ||
| - | |||
| - | Attention : | ||
| - | |||
| - | ==== Mise à jour des fichiers .ts à traduire dans HABBY ==== | ||
| - | |||
| - | * Vérifier que le fichier ‘habby_trans.pro’ contient bien les fichier.py contenant les champs à traduire | ||
| - | * Lancer dans l’environnement virtuel et dans ‘habby’ et pour mettre à jour les fichiers, lancer la commande : | ||
| - | |||
| - | python -m PyQt5.pylupdate_main habby_trans.pro | ||
| - | |||
| - | * Ouvrir le fichier de langue souhaité (ex : | ||
| - | * Dans le logiciel Linguist, renseigner les champs ‘French translation’ souhaités ; | ||
| - | * Sauvegarder le fichier ; | ||
| - | * Lancer l’invite de commande dans ‘habby’ | ||
| - | * Mettre à jour le fichier de langage choisi en lançant la commande (ici pour le fichier français) : | ||
| - | |||
| - | C: | ||
| - | |||
| - | * Relancer HABBY | ||