Skip to content

Commit c4b711c

Browse files
committed
Improved GUI translation:
- Allow translating texts before before Window is created -> Translate help text - Use AboutDialog instead of message box on Windows when starting GUI with -v
1 parent bcc0f87 commit c4b711c

17 files changed

Lines changed: 1076 additions & 680 deletions

gui/cppcheck_de.ts

Lines changed: 105 additions & 68 deletions
Large diffs are not rendered by default.

gui/cppcheck_es.ts

Lines changed: 91 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -165,17 +165,16 @@ Parameters: -l(line) (file)</source>
165165
<name>MainWindow</name>
166166
<message>
167167
<location filename="main.ui" line="26"/>
168-
<location filename="mainwindow.cpp" line="264"/>
169-
<location filename="mainwindow.cpp" line="322"/>
170-
<location filename="mainwindow.cpp" line="378"/>
171-
<location filename="mainwindow.cpp" line="441"/>
172-
<location filename="mainwindow.cpp" line="463"/>
173-
<location filename="mainwindow.cpp" line="656"/>
174-
<location filename="mainwindow.cpp" line="761"/>
175-
<location filename="mainwindow.cpp" line="881"/>
176-
<location filename="mainwindow.cpp" line="901"/>
177-
<location filename="mainwindow.cpp" line="1060"/>
178-
<location filename="mainwindow.cpp" line="1141"/>
168+
<location filename="mainwindow.cpp" line="262"/>
169+
<location filename="mainwindow.cpp" line="320"/>
170+
<location filename="mainwindow.cpp" line="376"/>
171+
<location filename="mainwindow.cpp" line="439"/>
172+
<location filename="mainwindow.cpp" line="461"/>
173+
<location filename="mainwindow.cpp" line="654"/>
174+
<location filename="mainwindow.cpp" line="759"/>
175+
<location filename="mainwindow.cpp" line="879"/>
176+
<location filename="mainwindow.cpp" line="1045"/>
177+
<location filename="mainwindow.cpp" line="1126"/>
179178
<source>Cppcheck</source>
180179
<translation>Cppcheck</translation>
181180
</message>
@@ -552,39 +551,39 @@ Parameters: -l(line) (file)</source>
552551
<translation>Mostrar &amp;ocultas</translation>
553552
</message>
554553
<message>
555-
<location filename="mainwindow.cpp" line="259"/>
554+
<location filename="mainwindow.cpp" line="257"/>
556555
<source>There was a problem with loading the editor application settings.
557556

558557
This is probably because the settings were changed between the Cppcheck versions. Please check (and fix) the editor application settings, otherwise the editor program might not start correctly.</source>
559558
<translation type="unfinished"></translation>
560559
</message>
561560
<message>
562-
<location filename="mainwindow.cpp" line="323"/>
561+
<location filename="mainwindow.cpp" line="321"/>
563562
<source>No suitable files found to check!</source>
564563
<translation>¡No se han encontrado ficheros para comprobar!</translation>
565564
</message>
566565
<message>
567-
<location filename="mainwindow.cpp" line="379"/>
566+
<location filename="mainwindow.cpp" line="377"/>
568567
<source>You must close the project file before selecting new files or directories!</source>
569568
<translation>¡Tienes que cerrar el fichero de proyecto antes de seleccionar nuevos ficheros o carpetas!</translation>
570569
</message>
571570
<message>
572-
<location filename="mainwindow.cpp" line="404"/>
571+
<location filename="mainwindow.cpp" line="402"/>
573572
<source>Select directory to check</source>
574573
<translation>Selecciona una carpeta para comprobar</translation>
575574
</message>
576575
<message>
577-
<location filename="mainwindow.cpp" line="672"/>
576+
<location filename="mainwindow.cpp" line="670"/>
578577
<source>XML files (*.xml)</source>
579578
<translation>Ficheros XML(*.xml)</translation>
580579
</message>
581580
<message>
582-
<location filename="mainwindow.cpp" line="674"/>
581+
<location filename="mainwindow.cpp" line="672"/>
583582
<source>Open the report file</source>
584583
<translation>Abrir informe</translation>
585584
</message>
586585
<message>
587-
<location filename="mainwindow.cpp" line="757"/>
586+
<location filename="mainwindow.cpp" line="755"/>
588587
<source>Checking is running.
589588

590589
Do you want to stop the checking and exit Cppcheck?.</source>
@@ -593,31 +592,22 @@ Do you want to stop the checking and exit Cppcheck?.</source>
593592
¿Quieres parar la comprobación y salir del Cppcheck?.</translation>
594593
</message>
595594
<message>
596-
<location filename="mainwindow.cpp" line="803"/>
595+
<location filename="mainwindow.cpp" line="801"/>
597596
<source>License</source>
598597
<translation>Licencia</translation>
599598
</message>
600599
<message>
601-
<location filename="mainwindow.cpp" line="810"/>
600+
<location filename="mainwindow.cpp" line="808"/>
602601
<source>Authors</source>
603602
<translation>Autores</translation>
604603
</message>
605604
<message>
606-
<location filename="mainwindow.cpp" line="818"/>
605+
<location filename="mainwindow.cpp" line="816"/>
607606
<source>XML files version 2 (*.xml);;XML files version 1 (*.xml);;Text files (*.txt);;CSV files (*.csv)</source>
608607
<translation type="unfinished"></translation>
609608
</message>
610609
<message>
611-
<location filename="mainwindow.cpp" line="895"/>
612-
<source>Failed to change the user interface language:
613-
614-
%1
615-
616-
The user interface language has been reset to English. Open the Preferences-dialog to select any of the available languages.</source>
617-
<translation type="unfinished"></translation>
618-
</message>
619-
<message>
620-
<location filename="mainwindow.cpp" line="820"/>
610+
<location filename="mainwindow.cpp" line="818"/>
621611
<source>Save the report file</source>
622612
<translation>Guardar informe</translation>
623613
</message>
@@ -627,85 +617,85 @@ The user interface language has been reset to English. Open the Preferences-dial
627617
<translation type="unfinished"></translation>
628618
</message>
629619
<message>
630-
<location filename="mainwindow.cpp" line="393"/>
620+
<location filename="mainwindow.cpp" line="391"/>
631621
<source>Select files to check</source>
632622
<translation type="unfinished">Selecciona ficheros para comprobar</translation>
633623
</message>
634624
<message>
635-
<location filename="mainwindow.cpp" line="442"/>
625+
<location filename="mainwindow.cpp" line="440"/>
636626
<source>Found project file: %1
637627

638628
Do you want to load this project file instead?</source>
639629
<translation type="unfinished"></translation>
640630
</message>
641631
<message>
642-
<location filename="mainwindow.cpp" line="464"/>
632+
<location filename="mainwindow.cpp" line="462"/>
643633
<source>Found project files from the directory.
644634

645635
Do you want to proceed checking without using any of these project files?</source>
646636
<translation type="unfinished"></translation>
647637
</message>
648638
<message>
649-
<location filename="mainwindow.cpp" line="657"/>
639+
<location filename="mainwindow.cpp" line="655"/>
650640
<source>Current results will be cleared.
651641

652642
Opening a new XML file will clear current results.Do you want to proceed?</source>
653643
<translation type="unfinished"></translation>
654644
</message>
655645
<message>
656-
<location filename="mainwindow.cpp" line="827"/>
646+
<location filename="mainwindow.cpp" line="825"/>
657647
<source>XML files version 1 (*.xml)</source>
658648
<translation type="unfinished"></translation>
659649
</message>
660650
<message>
661-
<location filename="mainwindow.cpp" line="831"/>
651+
<location filename="mainwindow.cpp" line="829"/>
662652
<source>XML files version 2 (*.xml)</source>
663653
<translation type="unfinished"></translation>
664654
</message>
665655
<message>
666-
<location filename="mainwindow.cpp" line="835"/>
656+
<location filename="mainwindow.cpp" line="833"/>
667657
<source>Text files (*.txt)</source>
668658
<translation>Ficheros de texto (*.txt)</translation>
669659
</message>
670660
<message>
671-
<location filename="mainwindow.cpp" line="839"/>
661+
<location filename="mainwindow.cpp" line="837"/>
672662
<source>CSV files (*.csv)</source>
673663
<translation>Ficheros CVS (*.cvs)</translation>
674664
</message>
675665
<message>
676-
<location filename="mainwindow.cpp" line="883"/>
666+
<location filename="mainwindow.cpp" line="881"/>
677667
<source>Cppcheck - %1</source>
678668
<translation>Cppcheck - %1</translation>
679669
</message>
680670
<message>
681-
<location filename="mainwindow.cpp" line="939"/>
682-
<location filename="mainwindow.cpp" line="1022"/>
671+
<location filename="mainwindow.cpp" line="924"/>
672+
<location filename="mainwindow.cpp" line="1007"/>
683673
<source>Project files (*.cppcheck);;All files(*.*)</source>
684674
<translation>Ficheros de proyecto (*.cppcheck;;Todos los ficheros (*.*)</translation>
685675
</message>
686676
<message>
687-
<location filename="mainwindow.cpp" line="941"/>
677+
<location filename="mainwindow.cpp" line="926"/>
688678
<source>Select Project File</source>
689679
<translation>Selecciona proyecto</translation>
690680
</message>
691681
<message>
692-
<location filename="mainwindow.cpp" line="969"/>
693-
<location filename="mainwindow.cpp" line="1036"/>
682+
<location filename="mainwindow.cpp" line="954"/>
683+
<location filename="mainwindow.cpp" line="1021"/>
694684
<source>Project:</source>
695685
<translation type="unfinished">Proyecto:</translation>
696686
</message>
697687
<message>
698-
<location filename="mainwindow.cpp" line="1024"/>
688+
<location filename="mainwindow.cpp" line="1009"/>
699689
<source>Select Project Filename</source>
700690
<translation>Selecciona el nombre del proyecto</translation>
701691
</message>
702692
<message>
703-
<location filename="mainwindow.cpp" line="1061"/>
693+
<location filename="mainwindow.cpp" line="1046"/>
704694
<source>No project file loaded</source>
705695
<translation>No hay ningún proyecto cargado</translation>
706696
</message>
707697
<message>
708-
<location filename="mainwindow.cpp" line="1136"/>
698+
<location filename="mainwindow.cpp" line="1121"/>
709699
<source>The project file
710700

711701
%1
@@ -716,70 +706,90 @@ Do you want to remove the file from the recently used projects -list?</source>
716706
<translation type="unfinished"></translation>
717707
</message>
718708
<message>
719-
<location filename="translationhandler.cpp" line="34"/>
709+
<location filename="translationhandler.cpp" line="35"/>
720710
<source>English</source>
721711
<translation>English</translation>
722712
</message>
723713
<message>
724-
<location filename="translationhandler.cpp" line="33"/>
714+
<location filename="translationhandler.cpp" line="34"/>
725715
<source>Dutch</source>
726716
<translation>Holandés</translation>
727717
</message>
728718
<message>
729-
<location filename="translationhandler.cpp" line="32"/>
719+
<location filename="translationhandler.cpp" line="33"/>
730720
<source>Chinese (Simplified)</source>
731721
<translation type="unfinished"></translation>
732722
</message>
733723
<message>
734-
<location filename="translationhandler.cpp" line="35"/>
724+
<location filename="translationhandler.cpp" line="36"/>
735725
<source>Finnish</source>
736726
<translation>Finés</translation>
737727
</message>
738728
<message>
739-
<location filename="translationhandler.cpp" line="36"/>
729+
<location filename="translationhandler.cpp" line="37"/>
740730
<source>French</source>
741731
<translation type="unfinished"></translation>
742732
</message>
743733
<message>
744-
<location filename="translationhandler.cpp" line="38"/>
734+
<location filename="translationhandler.cpp" line="39"/>
745735
<source>Italian</source>
746736
<translation type="unfinished"></translation>
747737
</message>
748738
<message>
749-
<location filename="translationhandler.cpp" line="40"/>
739+
<location filename="translationhandler.cpp" line="41"/>
750740
<source>Korean</source>
751741
<translation type="unfinished"></translation>
752742
</message>
753743
<message>
754-
<location filename="translationhandler.cpp" line="43"/>
744+
<location filename="translationhandler.cpp" line="44"/>
755745
<source>Spanish</source>
756746
<translation type="unfinished"></translation>
757747
</message>
758748
<message>
759-
<location filename="translationhandler.cpp" line="44"/>
749+
<location filename="translationhandler.cpp" line="45"/>
760750
<source>Swedish</source>
761751
<translation>Sueco</translation>
762752
</message>
763753
<message>
764-
<location filename="translationhandler.cpp" line="37"/>
754+
<location filename="translationhandler.cpp" line="38"/>
765755
<source>German</source>
766756
<translation>Alemán</translation>
767757
</message>
768758
<message>
769-
<location filename="translationhandler.cpp" line="41"/>
759+
<location filename="translationhandler.cpp" line="42"/>
770760
<source>Russian</source>
771761
<translation>Ruso</translation>
772762
</message>
773763
<message>
774-
<location filename="translationhandler.cpp" line="39"/>
764+
<location filename="translationhandler.cpp" line="40"/>
775765
<source>Japanese</source>
776766
<translation>Japonés</translation>
777767
</message>
778768
<message>
779-
<location filename="translationhandler.cpp" line="42"/>
769+
<location filename="translationhandler.cpp" line="43"/>
780770
<source>Serbian</source>
781771
<translation>Servio</translation>
782772
</message>
773+
<message>
774+
<location filename="main.cpp" line="87"/>
775+
<source>Cppcheck GUI.
776+
777+
Syntax:
778+
cppcheck-gui [OPTIONS] [files or paths]
779+
780+
Options:
781+
-h, --help Print this help
782+
-p &lt;file&gt; Open given project file and start checking it
783+
-l &lt;file&gt; Open given results xml file
784+
-d &lt;directory&gt; Specify the directory that was checked to generate the results xml specified with -l
785+
-v, --version Show program version</source>
786+
<translation type="unfinished"></translation>
787+
</message>
788+
<message>
789+
<location filename="main.cpp" line="99"/>
790+
<source>Cppcheck GUI - Command line parameters</source>
791+
<translation type="unfinished"></translation>
792+
</message>
783793
</context>
784794
<context>
785795
<name>Platforms</name>
@@ -934,17 +944,17 @@ Do you want to remove the file from the recently used projects -list?</source>
934944
<context>
935945
<name>QObject</name>
936946
<message>
937-
<location filename="translationhandler.cpp" line="78"/>
947+
<location filename="translationhandler.cpp" line="82"/>
938948
<source>Unknown language specified!</source>
939949
<translation type="unfinished"></translation>
940950
</message>
941951
<message>
942-
<location filename="translationhandler.cpp" line="90"/>
952+
<location filename="translationhandler.cpp" line="94"/>
943953
<source>Language file %1 not found!</source>
944954
<translation>¡Fichero de idioma %1 no encontrado!</translation>
945955
</message>
946956
<message>
947-
<location filename="translationhandler.cpp" line="96"/>
957+
<location filename="translationhandler.cpp" line="100"/>
948958
<source>Failed to load translation for language %1 from file %2</source>
949959
<translation>Fallo al cargar la traducción para el idioma %1 desde el fichero %2</translation>
950960
</message>
@@ -1552,6 +1562,23 @@ Para cambiar el tipo de comportamiento, abrir el menú vista.</translation>
15521562
<translation type="unfinished"></translation>
15531563
</message>
15541564
</context>
1565+
<context>
1566+
<name>TranslationHandler</name>
1567+
<message>
1568+
<location filename="translationhandler.cpp" line="106"/>
1569+
<source>Failed to change the user interface language:
1570+
1571+
%1
1572+
1573+
The user interface language has been reset to English. Open the Preferences-dialog to select any of the available languages.</source>
1574+
<translation type="unfinished"></translation>
1575+
</message>
1576+
<message>
1577+
<location filename="translationhandler.cpp" line="112"/>
1578+
<source>Cppcheck</source>
1579+
<translation type="unfinished">Cppcheck</translation>
1580+
</message>
1581+
</context>
15551582
<context>
15561583
<name>TxtReport</name>
15571584
<message>

0 commit comments

Comments
 (0)