Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente |
doc:translation [25/01/2023 15:58] – [Statut des traductions] scorpio810 | doc:translation [21/08/2024 09:14] (Version actuelle) – [How to update .ts files from source files?] scorpio810 |
---|
| |
====== Comment traduire QElectroTech dans une autre langue ? ====== | ====== Comment traduire QElectroTech dans une autre langue ? ====== |
===== Que faut-il traduire ? ===== | ===== What should be translated? ===== |
| |
Voici la liste (normalement exhaustive) des composants à traduire en une langue donnée pour QElectroTech : | Here is the (normally exhaustive) list of components to be translated into a given language for QElectroTech: |
* les chaînes dans le programme lui-même : fichiers ''.ts'' et ''.qm'' dans le dossier ''lang/'' ; | * the strings in the program itself: ''.ts'' and ''.qm'' files in the ''lang/'' folder; |
* Dans ''qetproject.cpp'', méthode QETProject::namesListForIntegrationCategory() : traduction codée en dur de "Éléments importés" à fournir au développeur ; | * In ''qetproject.cpp'', méthod QETProject::namesListForIntegrationCategory() : hard-coded translation of "Imported Items" to be provided to the developer; |
* les chaînes dans le toolkit Qt : généralement : fichiers ''.ts'' et ''.qm'' déjà traduits à chercher dans le .tar.gz officiel de la [[http://trolltech.com/downloads/opensource/appdev|dernière version de Qt]] ; | * The names in the elements collection: .elmt and qet_directory files in the ''elements/'' folder ; |
* les noms dans la collection d'éléments : fichiers .elmt et qet_directory dans le dossier ''elements/'' ; | * The shortcut to QElectroTech in the menus: file ''qelectrotech.desktop'' in ''misc/'' ; |
* le raccourci vers QElectroTech dans les menus : fichier ''qelectrotech.desktop'' dans ''misc/'' ; | * The Unix manual in ''man/'' ; |
* le manuel Unix dans ''man/'' ; | * The ''CREDIT'', ''README'', ''ELEMENTS.LICENSE'', ''INSTALL'' files ; |
* les fichiers ''CREDIT'', ''README'', ''ELEMENTS.LICENSE'', ''INSTALL'' ; | * The file ''packaging/linux/fedora/README.elements''. |
* le fichier ''packaging/linux/fedora/README.elements''. | |
* [[https://www.qt.io/offline-installers?hsLang=en]] | * [[https://www.qt.io/offline-installers?hsLang=en]] |
* [[http://doc.qt.io/qt-5/linguist-translators.html]] | * [[http://doc.qt.io/qt-5/linguist-translators.html]] |
* [[http://l10n-files.qt.io/l10n-files/|Qt daily updated translation files]] | * [[http://l10n-files.qt.io/l10n-files/|Qt daily updated translation files]] |
* [[https://wiki.qt.io/Qt_Localization|wiki Qt_Localization ]] | * [[https://wiki.qt.io/Qt_Localization|wiki Qt_Localization ]] |
* [[https://qelectrotech.org/forum/viewtopic.php?pid=16027#p16027|Qet_translate : Element translation tool]] [[https://download.tuxfamily.org/qet/builds/qet_translate/ |Download ]] | * [[https://qelectrotech.org/forum/viewtopic.php?pid=16027#p16027|Qet_translate : Element translation tool]] [[https://download.qelectrotech.org/qet/builds/qet_translate/ |Download ]] |
===== Et après ? ===== | ===== And after ? ===== |
* Maintenance des traductions par un suivi régulier des modifications dans le dépôt Git ou Github ; | * Maintenance of translations by regular monitoring of changes in the Git or Github repository; |
* traduction de la documentation sur le Wiki. | |
| |
===== Comment tester sa traduction ===== | ===== How to test your translation ===== |
| |
==== Windows ==== | ==== Windows ==== |
| |
Le plus simple étant de changer la langue du système. | The easiest way is to change the system language. |
| |
Autre solution: dans le lanceur [color=red]Lancer Qet.bat[/color] on rajoute dans le (set command=) un [color=blue]set LANG=en_US[/color] par exemple | Another solution: in the launcher [color=red]Lancer Qet.bat[/color] we add in the (set command=) un [color=blue]set LANG=en_US[/color] by example |
| |
__Ce qui donne:__ | __Which give:__ |
| |
<code> | <code> |
</code> | </code> |
| |
ou | Or |
| |
<code> | <code> |
| |
Download this script to put in your git copy | Download this script to put in your git copy |
<code>wget http://download.tuxfamily.org/qet/scripts/detect_non_translated_elements.sh</code> | <code>wget https://download.qelectrotech.org/qet/scripts/detect_non_translated_elements.sh</code> |
| |
Make it executable | Make it executable |
===== How to update .ts files from source files? ===== | ===== How to update .ts files from source files? ===== |
Note: *.ts are generally updated by the developer when he considers that the character strings to be translated are viable or by translators. | Note: *.ts are generally updated by the developer when he considers that the character strings to be translated are viable or by translators. |
* Édit qelectrotech.pro : Comment out the lines starting with ''TRANSLATIONS += '' : <code bash>sed -i 's/^TRANSLATIONS/#TRANSLATIONS/g' qelectrotech.pro</code> | * Édit qelectrotech.pro file: Comment out the lines starting with ''TRANSLATIONS += '' : <code bash>sed -i 's/^TRANSLATIONS/#TRANSLATIONS/g' qelectrotech.pro</code> |
* Run the following command :: <code>lupdate -noobsolete qelectrotech.pro -ts lang/qet_{en,es,ru,pt,cs,pl,ca,de,ro,it,ar,sl,hr,el,nl,be,sl,zh,hu,pt_br,da,sr,fr,tr,sk,nb,mn,ja,cn,uk}.ts</code> | * Run the following command: <code>lupdate -noobsolete qelectrotech.pro -ts lang/qet_{ar,be,ca,cs,da,de,el,en,es,fr_FR,hr,hu,it,ja,mn,nb,nl,pl,pt,pt_BR,ro,ru,sk,sl,sr,tr,uk,zh}.ts</code> |
* Restore missing references to source files : <code>/usr/lib/x86_64-linux-gnu/qt5/bin/lupdate -locations absolute qelectrotech.pro -ts lang/qet_br.ts</code> | * Restore missing references to source files : <code>/usr/lib/x86_64-linux-gnu/qt5/bin/lupdate -locations absolute qelectrotech.pro -ts lang/qet_br.ts</code> |
* Restore file qelectrotech.pro : <code bash>sed -i 's/^#TRANSLATIONS/TRANSLATIONS/g' qelectrotech.pro</code> | * Restore file qelectrotech.pro: <code bash>sed -i 's/^#TRANSLATIONS/TRANSLATIONS/g' qelectrotech.pro</code> |
* Create translations binary files : <code>lrelease lang/qet_*.ts</code> | * Generate translation binaries: <code>lrelease lang/qet_*.ts</code> |
| |
===== translation status ===== | ===== translation status ===== |
* Qt translations are always considered done as they are the responsibility of Qt Software, with the exception of the Czech translation, handled by Pavel Fric via Gitorious : cf [[doc:qt_translation_cs|Qt translation to czech]] | * Qt translations are always considered done as they are the responsibility of Qt Software, with the exception of the Czech translation, handled by Pavel Fric via Gitorious : cf [[doc:qt_translation_cs|Qt translation to czech]] |
| |
===== Scripts divers ===== | ===== Miscellaneous scripts ===== |
| |
Tous les scripts anciennement présentés dans cette section ont été intégrés dans le script [[https://git.tuxfamily.org/qet/qet.git/tree/misc/translations_stat.pl|misc/translations_stat.pl]]. | All scripts formerly presented in this section have been integrated into the script [[https://git.tuxfamily.org/qet/qet.git/tree/misc/translations_stat.pl|misc/translations_stat.pl]]. |