Differences
This shows you the differences between two versions of the page.
fr:develop:collaboration:dev:translation [2021/03/11 21:55] – créée qroyer | fr:develop:collaboration:dev:translation [2021/09/28 16:17] () – qroyer | ||
---|---|---|---|
1: | 1: | ||
- | ===== Traduction du logiciel ===== | + | ====== Traduction du logiciel |
- | ==== Prés-requis ==== | + | ===== Prés-requis |
* Linguist.exe : (https:// | * Linguist.exe : (https:// | ||
- | * environnement | + | * environnement |
- | ==== Utilisation dans le code ==== | + | ===== Utilisation dans le code ===== |
- | === Traduire des champs dans des classes Qt === | + | ==== Traduire des champs dans des classes Qt ==== |
- | | + | |
- | === Traduire des champs en dehors des classes Qt === | + | ==== Traduire des champs en dehors des classes Qt ==== |
Si pas de classe ou heritage de classe qui pose problème : | Si pas de classe ou heritage de classe qui pose problème : | ||
- | | + | |
- | text = QCoreApplication.translate(‘Input’, | + | text = QCoreApplication.translate(‘Input’, |
Ou | Ou | ||
- | | + | |
- | languageTranslator = QTranslator(app) | + | languageTranslator = QTranslator(app) |
- | if language == 0: | + | if language == 0: |
- | input_file_translation = ' | + | input_file_translation = ' |
- | languageTranslator.load(input_file_translation, | + | languageTranslator.load(input_file_translation, |
- | if language == 1: | + | if language == 1: |
- | input_file_translation = ' | + | input_file_translation = ' |
- | languageTranslator.load(input_file_translation, | + | languageTranslator.load(input_file_translation, |
- | elif language == 2: | + | elif language == 2: |
- | input_file_translation = ' | + | input_file_translation = ' |
- | languageTranslator.load(input_file_translation, | + | languageTranslator.load(input_file_translation, |
- | app.installTranslator(languageTranslator) | + | app.installTranslator(languageTranslator) |
- | app.translate(‘Input’, | + | app.translate(‘Input’, |
- | Attention : ne pas traduire ‘Warning :’ dans les champs de log car utilisé pour le code couleur. | + | ===== Mise à jour des fichiers .ts à traduire dans HABBY ===== |
- | + | ||
- | ==== 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 | * Vérifier que le fichier ‘habby_trans.pro’ contient bien les fichier.py contenant les champs à traduire | ||
- | * Lancer | + | * Pour mettre à jour les fichiers, lancer |
python -m PyQt5.pylupdate_main habby_trans.pro | python -m PyQt5.pylupdate_main habby_trans.pro | ||
52: | 50: | ||
* Relancer HABBY | * Relancer HABBY | ||
+ | |||
+ | {{indexmenu_n> |