Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
doc:translation [24/10/2016 07:19] – [Que faut-il traduire ?] scorpio810doc:translation [28/03/2024 15:02] (Version actuelle) – [How to update .ts files from source files?] scorpio810
Ligne 1: Ligne 1:
 +~~NOCACHE~~
  
 +====== Comment traduire QElectroTech dans une autre langue ? ======
 +===== What should be translated? =====
 +
 +Here is the (normally exhaustive) list of components to be translated into a given language for QElectroTech:
 +  * the strings in the program itself: ''.ts'' and ''.qm'' files in the ''lang/'' folder;
 +  * In ''qetproject.cpp'', méthod QETProject::namesListForIntegrationCategory() : hard-coded translation of "Imported Items" to be provided to the developer;
 +  * The names in the elements collection: .elmt and qet_directory files in the ''elements/'' folder ;
 +  * The shortcut to QElectroTech in the menus: file ''qelectrotech.desktop'' in ''misc/'' ;
 +  * The Unix manual in ''man/'' ;
 +  * The ''CREDIT'', ''README'', ''ELEMENTS.LICENSE'', ''INSTALL'' files ;
 +  * The file ''packaging/linux/fedora/README.elements''.
 +  * [[https://www.qt.io/offline-installers?hsLang=en]]
 +  * [[http://doc.qt.io/qt-5/linguist-translators.html]]
 +  * [[http://l10n-files.qt.io/l10n-files/|Qt daily updated translation files]]
 +  * [[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.qelectrotech.org/qet/builds/qet_translate/ |Download ]]
 +===== And after ? ===== 
 +  * Maintenance of translations by regular monitoring of changes in the Git or Github repository;
 +  
 +
 +===== How to test your translation =====
 +
 +==== Windows ====
 +
 +The easiest way is to change the system language.
 +
 +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
 +
 +__Which give:__
 +
 +<code>
 +..........
 +set command=bin\qelectrotech.exe --common-elements-dir=elements/ --common-tbt-dir=titleblocks/ --lang-dir=lang/ --config-dir=conf/ 
 +set LANG=en_US -style plastique %*
 +.............
 +</code>
 +
 +Or
 +
 +<code>
 +...........
 +set LANG=en_US
 +rem lance QElectroTech
 +set command=bin\qelectrotech.exe --common-elements-dir=elements/ --common-tbt-dir=titleblocks/ --lang-dir=lang/ --config-dir=conf/ -style plastique %*
 +................
 +</code>
 +==== linux ====
 +
 +<code>
 +laurent@debian:~$ export LANG="en_US";    qelectrotech
 +</code>
 +
 +Ou
 +
 +<code>
 +laurent@debian:~$ LANG="en_US" qelectrotech
 +</code>
 +
 +===== Find untranslated elements in a given language =====
 +
 +Download this script to put in your git copy
 +<code>wget https://download.qelectrotech.org/qet/scripts/detect_non_translated_elements.sh</code>
 +
 +Make it executable
 +
 +<code>chmod +x detect_non_translated_elements.sh</code>
 +
 +Find items not translated into Polish for example:
 +
 +
 +<code>laurent@debian:~/Qet-svn/qet_directory$ ./detect_non_translated_elements.sh pl
 +./elements/automatisme/domotique/qet_directory
 +./elements/automatisme/regulateurs/wit/wit6.2ucentrale.elmt
 +./elements/domestique/electromenager/eclairage.elmt
 +./elements/domestique/electromenager/lave-linge.elmt
 +./elements/domestique/electromenager/arrosage-auto.elmt
 +./elements/domestique/electromenager/terre.elmt
 +./elements/domestique/electromenager/gestion-energie.elmt
 +./elements/nomenclatures/grille_composition.elmt</code>
 +
 +
 +
 +===== What tools? =====
 +  * To participate in the project: some notions of using Git;
 +  * To test the application under development and thus test the translations of recent strings: a [[doc:test_dev_version|version compilée de QET]] ;
 +  * For the .ts / .qm : [[https://doc.qt.io/qt-6/qtlinguist-index.html|Qt Linguist]] (as well as utilities lupdate et lrelease) ;
 +  * for other files: any text editor worthy of the name.
 +
 +
 +It is of course possible to learn how to use these tools on the job by coming to our IRC channel.
 +If you want to translate QElectroTech, contact the development team by email or visit our IRC channel. The languages accepted to communicate with the development team are French and English.
 +===== 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.
 +  * É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_{ar,be,ca,cs,da,de,el,en,es,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 file qelectrotech.pro: <code bash>sed -i 's/^#TRANSLATIONS/TRANSLATIONS/g' qelectrotech.pro</code>
 +  * Generate translation binaries: <code>lrelease lang/qet_*.ts</code>
 +
 +===== translation status =====
 +
 +**Statistics for the master branch**
 +{{page>doc:translation:stats&nofooter&noeditbtn}}
 +
 +Notes :
 +  * 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]]
 +
 +===== Miscellaneous scripts =====
 +
 +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]].
Imprimer/exporter