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/09/28 16:15] – qroyer | fr:develop:collaboration:dev:translation [2021/09/28 16:17] (current) – qroyer | ||
---|---|---|---|
Line 10: | Line 10: | ||
==== Traduire des champs dans des classes Qt ==== | ==== Traduire des champs dans des classes Qt ==== | ||
- | self.tr(‘string to translate’) | + | |
==== 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’, |
===== Mise à jour des fichiers .ts à traduire dans HABBY ===== | ===== Mise à jour des fichiers .ts à traduire dans HABBY ===== |