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:translation [2021/03/11 21:56] – qroyer | fr:develop:collaboration:dev:translation [2021/09/28 16:17] (current) – qroyer | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| * Linguist.exe : (https:// | * Linguist.exe : (https:// | ||
| - | * environnement | + | * environnement |
| ===== Utilisation dans le code ===== | ===== Utilisation dans le code ===== | ||
| Line 10: | Line 10: | ||
| ==== 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 ==== | ||
| Line 16: | Line 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 : | ||
| - | | + | |
| - | 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 | ||
| Line 52: | Line 50: | ||
| * Relancer HABBY | * Relancer HABBY | ||
| + | |||
| + | {{indexmenu_n> | ||