diff options
author | hjk <hjk@qt.io> | 2022-07-13 18:31:56 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2022-08-01 12:16:41 +0000 |
commit | 960e99ecb18e1d4d54057ef5c540fc1bd611e336 (patch) | |
tree | 75916e73dd723c3bb26faf6c65393911f2bb2efa | |
parent | ce7a76107514f4cf90f9040fdc549c7398b0e565 (diff) | |
download | qt-creator-960e99ecb18e1d4d54057ef5c540fc1bd611e336.tar.gz |
Autotest: Convert to Tr::tr
Change-Id: Ifd4b6ace78d02804ec3b3c1d60c5418081cad6c4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
62 files changed, 518 insertions, 983 deletions
diff --git a/share/qtcreator/translations/qtcreator_da.ts b/share/qtcreator/translations/qtcreator_da.ts index 0aa00ff246..4269b6d43b 100644 --- a/share/qtcreator/translations/qtcreator_da.ts +++ b/share/qtcreator/translations/qtcreator_da.ts @@ -1628,7 +1628,7 @@ Installer en SDK af mindst API version %1.</translation> </message> </context> <context> - <name>Autotest::Internal::AutotestPlugin</name> + <name>Autotest</name> <message> <source>&Tests</source> <translation>&Tests</translation> @@ -1691,7 +1691,7 @@ Installer en SDK af mindst API version %1.</translation> </message> </context> <context> - <name>Autotest::Internal::GTestOutputReader</name> + <name>Autotest</name> <message> <source>Running tests failed. %1 @@ -1733,7 +1733,7 @@ Eksekverbar: %2</translation> </message> </context> <context> - <name>Autotest::Internal::GTestSettingsPage</name> + <name>Autotest</name> <message> <source>Turns failures into debugger breakpoints.</source> <translation>Omdanner fejl til fejlretter-brudpunkter.</translation> @@ -1814,11 +1814,7 @@ Se Google Test-dokumentation for yderligere information om GTest-filtre.</transl </message> </context> <context> - <name>Autotest::Internal::QtTestOutputReader</name> - <message> - <source>Executing test case %1</source> - <translation>Eksekverer testsag %1</translation> - </message> + <name>Autotest</name> <message> <source>Entering test function %1::%2</source> <translation>Træder ind i testfunktion %1::%2</translation> @@ -1865,7 +1861,7 @@ Se Google Test-dokumentation for yderligere information om GTest-filtre.</transl </message> </context> <context> - <name>Autotest::Internal::QtTestSettingsPage</name> + <name>Autotest</name> <message> <source>Enables interrupting tests on assertions.</source> <translation>Aktiverer afbrydning af tests ved påstande.</translation> @@ -1944,7 +1940,7 @@ Advarsel: Ren tekst mangle nogle informationer, såsom varighed.</translation> </message> </context> <context> - <name>Autotest::Internal::RunConfigurationSelectionDialog</name> + <name>Autotest</name> <message> <source>Select Run Configuration</source> <translation>Vælg kør-konfiguration</translation> @@ -1971,7 +1967,7 @@ Advarsel: Ren tekst mangle nogle informationer, såsom varighed.</translation> </message> </context> <context> - <name>Autotest::Internal::TestCodeParser</name> + <name>Autotest</name> <message> <source>AutoTest Plugin WARNING: No files left after filtering test scan folders. Check test filter settings.</source> <translation>ADVARSEL for AutoTest-plugin: Ingen filer tilbage efter filtrering af testskanmapper. Tjek testfilterindstillinger.</translation> @@ -1980,30 +1976,11 @@ Advarsel: Ren tekst mangle nogle informationer, såsom varighed.</translation> <source>Scanning for Tests</source> <translation>Skanner for tests</translation> </message> -</context> -<context> - <name>Autotest::Internal::TestNavigationWidget</name> - <message> - <source>Tests</source> - <translation>Tests</translation> - </message> - <message> - <source>No active test frameworks.</source> - <translation>Ingen aktive test-frameworks.</translation> - </message> - <message> - <source>Run This Test</source> - <translation>Kør denne test</translation> - </message> <message> <source>Run Without Deployment</source> <translation>Kør uden udsendelse</translation> </message> <message> - <source>Debug This Test</source> - <translation>Fejlret denne test</translation> - </message> - <message> <source>Debug Without Deployment</source> <translation>Fejlret uden udsendelse</translation> </message> @@ -2045,18 +2022,14 @@ Advarsel: Ren tekst mangle nogle informationer, såsom varighed.</translation> </message> </context> <context> - <name>Autotest::Internal::TestNavigationWidgetFactory</name> + <name>Autotest</name> <message> <source>Tests</source> <translation>Tests</translation> </message> </context> <context> - <name>Autotest::Internal::TestResultsPane</name> - <message> - <source>Expand All</source> - <translation>Udfold alle</translation> - </message> + <name>Autotest</name> <message> <source>Stop Test Run</source> <translation>Stop testkørsel</translation> @@ -2179,14 +2152,14 @@ Advarsel: Ren tekst mangle nogle informationer, såsom varighed.</translation> </message> </context> <context> - <name>Autotest::Internal::TestRunConfiguration</name> + <name>Autotest</name> <message> <source>AutoTest Debug</source> <translation>AutoTest-fejlret</translation> </message> </context> <context> - <name>Autotest::Internal::TestRunner</name> + <name>Autotest</name> <message> <source>Test run canceled by user.</source> <translation>Testkørsel annulleret af bruger.</translation> @@ -2293,7 +2266,7 @@ Kun desktop kits understøttes. Sørg for at det aktuelt aktive kit er et deskto </message> </context> <context> - <name>Autotest::Internal::TestSettingsPage</name> + <name>Autotest</name> <message> <source>General</source> <translation>Generelt</translation> @@ -2398,7 +2371,7 @@ Advarsel: dette er en eksperimentel facilitet og kan lede til at test-eksekverba </message> </context> <context> - <name>Autotest::Internal::TestSettingsWidget</name> + <name>Autotest</name> <message> <source>No active test frameworks.</source> <translation>Ingen aktive test-frameworks.</translation> @@ -44254,7 +44227,7 @@ Spordataene er tabt.</translation> </message> </context> <context> - <name>Autotest::Internal::TestOutputReader</name> + <name>Autotest</name> <message> <source>Test executable crashed.</source> <translation>Test-eksekverbar holdt op med at virke.</translation> diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index a15c6b19e3..df4bff08e6 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -34092,7 +34092,7 @@ Das Setzen von Haltepunkten anhand von Dateinamen und Zeilennummern könnte fehl </message> </context> <context> - <name>Autotest::Internal::TestSettingsPage</name> + <name>Autotest</name> <message> <source>General</source> <translation>Allgemein</translation> @@ -34793,7 +34793,7 @@ Allerdings führt die Anwendung der weniger strikten und erweiterten Regeln dazu </message> </context> <context> - <name>Autotest::Internal::AutotestPlugin</name> + <name>Autotest</name> <message> <source>&Run Test Under Cursor</source> <translation>Test unter Cursor &ausführen</translation> @@ -34804,35 +34804,19 @@ Allerdings führt die Anwendung der weniger strikten und erweiterten Regeln dazu </message> </context> <context> - <name>Autotest::Internal::TestCodeParser</name> + <name>Autotest</name> <message> <source>Scanning for Tests</source> <translation>Suche nach Tests</translation> </message> </context> <context> - <name>Autotest::Internal::TestNavigationWidget</name> - <message> - <source>Tests</source> - <translation>Tests</translation> - </message> - <message> - <source>No active test frameworks.</source> - <translation>Keine aktiven Test-Frameworks.</translation> - </message> - <message> - <source>Run This Test</source> - <translation>Diesen Test starten</translation> - </message> + <name>Autotest</name> <message> <source>Run Without Deployment</source> <translation>Ausführung ohne Deployment</translation> </message> <message> - <source>Debug This Test</source> - <translation>Diesen Test debuggen</translation> - </message> - <message> <source>Debug Without Deployment</source> <translation>Debuggen ohne Deployment</translation> </message> @@ -34874,14 +34858,14 @@ Allerdings führt die Anwendung der weniger strikten und erweiterten Regeln dazu </message> </context> <context> - <name>Autotest::Internal::TestNavigationWidgetFactory</name> + <name>Autotest</name> <message> <source>Tests</source> <translation>Tests</translation> </message> </context> <context> - <name>Autotest::Internal::QtTestOutputReader</name> + <name>Autotest</name> <message> <source>%1 %2 per iteration (total: %3, iterations: %4)</source> <translation>%1 %2 pro Durchlauf (Summe: %3, Durchläufe: %4)</translation> @@ -34932,7 +34916,7 @@ Allerdings führt die Anwendung der weniger strikten und erweiterten Regeln dazu </message> </context> <context> - <name>Autotest::Internal::GTestOutputReader</name> + <name>Autotest</name> <message> <source>Running tests failed. %1 @@ -34950,28 +34934,16 @@ Ausführbare Datei: %2</translation> <translation>Wiederhole Test-Suite %1 (%2. Durchlauf)</translation> </message> <message> - <source>Executing test suite %1</source> - <translation>Führe Test-Suite %1 aus</translation> - </message> - <message> <source>Entering test case %1</source> <translation>Führe Testfall %1 aus</translation> </message> <message> - <source>Test execution took %1</source> - <translation>Testausführung benötigte %1</translation> - </message> - <message> <source>Execution took %1.</source> <translation>Ausführung benötigte %1.</translation> </message> </context> <context> - <name>Autotest::Internal::TestResultsPane</name> - <message> - <source>Expand All</source> - <translation>Alles aufklappen</translation> - </message> + <name>Autotest</name> <message> <source>Stop Test Run</source> <translation>Testlauf anhalten</translation> @@ -35106,7 +35078,7 @@ Ausführbare Datei: %2</translation> </message> </context> <context> - <name>Autotest::Internal::TestRunner</name> + <name>Autotest</name> <message> <source>Test run canceled by user.</source> <translation>Testlauf durch den Benutzer abgebrochen.</translation> @@ -36305,14 +36277,14 @@ Siehe auch die Einstellungen für Google Test.</translation> </message> </context> <context> - <name>Autotest::Internal::TestRunConfiguration</name> + <name>Autotest</name> <message> <source>AutoTest Debug</source> <translation>AutoTest Debug</translation> </message> </context> <context> - <name>Autotest::Internal::TestSettingsWidget</name> + <name>Autotest</name> <message> <source>No active test frameworks.</source> <translation>Keine aktiven Test-Frameworks.</translation> @@ -37051,7 +37023,7 @@ Siehe auch die Einstellungen für Google Test.</translation> </message> </context> <context> - <name>Autotest::Internal::GTestSettingsPage</name> + <name>Autotest</name> <message> <source>Turns failures into debugger breakpoints.</source> <translation>Erzeugt aus Fehlern Debugger-Haltepunkte.</translation> @@ -37132,7 +37104,7 @@ Weitere Informationen über GTest-Filter finden Sie in der Dokumenation von Goog </message> </context> <context> - <name>Autotest::Internal::QtTestSettingsPage</name> + <name>Autotest</name> <message> <source>Enables interrupting tests on assertions.</source> <translation>Hält Tests bei Assertions an.</translation> @@ -41147,7 +41119,7 @@ Breche ausstehende Operationen ab... </message> </context> <context> - <name>Autotest::Internal::RunConfigurationSelectionDialog</name> + <name>Autotest</name> <message> <source>Select Run Configuration</source> <translation>Ausführungskonfiguration auswählen</translation> @@ -45651,7 +45623,7 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e </message> </context> <context> - <name>Autotest::Internal::AutotestPluginPrivate</name> + <name>Autotest</name> <message> <source>Testing</source> <translation>Testen</translation> @@ -45726,18 +45698,14 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e </message> </context> <context> - <name>BoostTestFramework</name> + <name>Autotest</name> <message> <source>Boost Test</source> <translation>Boost Test</translation> </message> </context> <context> - <name>Autotest::Internal::BoostTestOutputReader</name> - <message> - <source>Executing test case %1</source> - <translation>Führe Testfall %1 aus</translation> - </message> + <name>Autotest</name> <message> <source>Executing test suite %1</source> <translation>Führe Test-Suite %1 aus</translation> @@ -45748,7 +45716,7 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e </message> </context> <context> - <name>BoostTestTreeItem</name> + <name>Autotest</name> <message> <source>parameterized</source> <translation>parametrisiert</translation> @@ -45763,7 +45731,7 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e </message> </context> <context> - <name>Autotest::Internal::ProjectTestSettingsWidget</name> + <name>Autotest</name> <message> <source>Global</source> <translation>Global</translation> @@ -45773,17 +45741,6 @@ Wenn Sie noch keinen privaten Schlüssel besitzen, können Sie hier auch einen e <translation>Benutzerdefiniert</translation> </message> <message> - <source>All</source> - <translation>Alle</translation> - </message> - <message> - <source>Selected</source> - <translation>Ausgewählte</translation> - </message> -</context> -<context> - <name>Autotest::TestOutputReader</name> - <message> <source>Test executable crashed.</source> <translation>Die ausführbare Datei des Tests ist abgestürzt.</translation> </message> diff --git a/share/qtcreator/translations/qtcreator_hr.ts b/share/qtcreator/translations/qtcreator_hr.ts index c394dd1f4d..259878b040 100644 --- a/share/qtcreator/translations/qtcreator_hr.ts +++ b/share/qtcreator/translations/qtcreator_hr.ts @@ -1131,7 +1131,7 @@ Odustajanje od izvršavanja neriješenih operacija … </message> </context> <context> - <name>Autotest::Internal::GTestSettingsPage</name> + <name>Autotest</name> <message> <source>Turns failures into debugger breakpoints.</source> <translation>Pretvara neuspjehe u točke prekida pri uklanjanju grešaka.</translation> @@ -1212,7 +1212,7 @@ Dodatne dokumente o GTest filtrima potraži u Google Test dokumentaciji.</transl </message> </context> <context> - <name>Autotest::Internal::QtTestSettingsPage</name> + <name>Autotest</name> <message> <source>Enables interrupting tests on assertions.</source> <translation>Omogućuje prekid testova kod potvrda.</translation> @@ -1291,7 +1291,7 @@ Upozorenje: Običan tekst propušta neke informacije, kao što je trajanje.</tra </message> </context> <context> - <name>Autotest::Internal::TestSettingsPage</name> + <name>Autotest</name> <message> <source>General</source> <translation>Opće</translation> @@ -15164,7 +15164,7 @@ The files in the Android package source directory are copied to the build direct </message> </context> <context> - <name>Autotest::Internal::AutotestPlugin</name> + <name>Autotest</name> <message> <source>&Tests</source> <translation type="unfinished"></translation> @@ -15255,7 +15255,7 @@ See also Google Test settings.</source> </message> </context> <context> - <name>Autotest::Internal::GTestOutputReader</name> + <name>Autotest</name> <message> <source>Running tests failed. %1 @@ -15282,21 +15282,9 @@ Executable: %2</source> <source>Repeating test case %1 (iteration %2)</source> <translation type="unfinished"></translation> </message> - <message> - <source>Executing test case %1</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Entering test set %1</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Execution took %1.</source> - <translation type="unfinished"></translation> - </message> </context> <context> - <name>GTestTreeItem</name> + <name>Autotest</name> <message> <source><matching></source> <translation type="unfinished"></translation> @@ -15319,14 +15307,14 @@ Executable: %2</source> </message> </context> <context> - <name>QtTestFramework</name> + <name>Autotest</name> <message> <source>Qt Test</source> <translation>Qt test</translation> </message> </context> <context> - <name>Autotest::Internal::QtTestOutputReader</name> + <name>Autotest</name> <message> <source>%1 %2 per iteration (total: %3, iterations: %4)</source> <translation type="unfinished"></translation> @@ -15377,21 +15365,21 @@ Executable: %2</source> </message> </context> <context> - <name>QtTestTreeItem</name> + <name>Autotest</name> <message> <source>inherited</source> <translation>naslijeđeno</translation> </message> </context> <context> - <name>QuickTestFramework</name> + <name>Autotest</name> <message> <source>Quick Test</source> <translation type="unfinished"></translation> </message> </context> <context> - <name>QuickTestTreeItem</name> + <name>Autotest</name> <message> <source><unnamed></source> <translation type="unfinished"></translation> @@ -15402,7 +15390,7 @@ Executable: %2</source> </message> </context> <context> - <name>Autotest::Internal::TestCodeParser</name> + <name>Autotest</name> <message> <source>AutoTest Plugin WARNING: No files left after filtering test scan folders. Check test filter settings.</source> <translation type="unfinished"></translation> @@ -15413,31 +15401,7 @@ Executable: %2</source> </message> </context> <context> - <name>Autotest::Internal::TestNavigationWidget</name> - <message> - <source>Tests</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>No active test frameworks.</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Run This Test</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Run Without Deployment</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Debug This Test</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Debug Without Deployment</source> - <translation type="unfinished"></translation> - </message> + <name>Autotest</name> <message> <source>Select All</source> <translation>Odaberi sve</translation> @@ -15447,87 +15411,6 @@ Executable: %2</source> <translation type="unfinished">Odznači sav odabir</translation> </message> <message> - <source>Filter Test Tree</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Sort Naturally</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Expand All</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Collapse All</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Sort Alphabetically</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Show Init and Cleanup Functions</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Show Data Functions</source> - <translation type="unfinished"></translation> - </message> -</context> -<context> - <name>Autotest::Internal::TestNavigationWidgetFactory</name> - <message> - <source>Tests</source> - <translation type="unfinished"></translation> - </message> -</context> -<context> - <name>Autotest::Internal::TestOutputReader</name> - <message> - <source>Test executable crashed.</source> - <translation type="unfinished"></translation> - </message> -</context> -<context> - <name>Autotest::Internal::TestResultsPane</name> - <message> - <source>Expand All</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Stop Test Run</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Filter Test Results</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Switch Between Visual and Text Display</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Test Results</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Pass</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Fail</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Expected Fail</source> - <translation type="unfinished"></translation> - </message> - <message> - <source>Unexpected Pass</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Skip</source> <translation>Preskoči</translation> </message> @@ -15627,14 +15510,14 @@ Executable: %2</source> </message> </context> <context> - <name>Autotest::Internal::TestRunConfiguration</name> + <name>Autotest</name> <message> <source>AutoTest Debug</source> <translation type="unfinished"></translation> </message> </context> <context> - <name>Autotest::Internal::TestRunner</name> + <name>Autotest</name> <message> <source>Test run canceled by user.</source> <translation type="unfinished"></translation> @@ -15741,7 +15624,7 @@ Check the test environment.</source> </message> </context> <context> - <name>Autotest::Internal::RunConfigurationSelectionDialog</name> + <name>Autotest</name> <message> <source>Select Run Configuration</source> <translation type="unfinished"></translation> @@ -15772,7 +15655,7 @@ Check the test environment.</source> </message> </context> <context> - <name>Autotest::Internal::TestSettingsWidget</name> + <name>Autotest</name> <message> <source>No active test frameworks.</source> <translation type="unfinished"></translation> diff --git a/share/qtcreator/translations/qtcreator_ja.ts b/share/qtcreator/translations/qtcreator_ja.ts index 5332939525..b34585fa64 100644 --- a/share/qtcreator/translations/qtcreator_ja.ts +++ b/share/qtcreator/translations/qtcreator_ja.ts @@ -37077,7 +37077,7 @@ Android 5 ではローカルの Qt ライブラリをデプロイできません </message> </context> <context> - <name>Autotest::Internal::TestSettingsPage</name> + <name>Autotest</name> <message> <source>Form</source> <translation>フォーム</translation> @@ -37175,10 +37175,6 @@ Android 5 ではローカルの Qt ライブラリをデプロイできません <translation>テストをシャッフルする</translation> </message> <message> - <source>Seed:</source> - <translation>シード:</translation> - </message> - <message> <source>A seed of 0 generates a seed based on the current timestamp.</source> <translation>シードが 0 の場合、現在時刻からシードが生成されます。</translation> </message> @@ -37191,42 +37187,6 @@ Android 5 ではローカルの Qt ライブラリをデプロイできません <translation>ベンチマーク実行時に待ち時間を基準に用います(既定)。</translation> </message> <message> - <source>Walltime</source> - <translation>総経過時間</translation> - </message> - <message> - <source>Uses tick counter when executing benchmarks.</source> - <translation>ベンチマーク実行時にチックカウンタを基準に用います。</translation> - </message> - <message> - <source>Tick counter</source> - <translation>ティックカウンタ</translation> - </message> - <message> - <source>Uses event counter when executing benchmarks.</source> - <translation>ベンチマーク実行時にイベントカウンタを基準に用います。</translation> - </message> - <message> - <source>Event counter</source> - <translation>イベントカウンタ</translation> - </message> - <message> - <source>Uses Valgrind Callgrind when executing benchmarks (it must be installed).</source> - <translation>ベンチマーク実行時に Valgrind Callgrind を用います(インストールが必要です)。</translation> - </message> - <message> - <source>Callgrind</source> - <translation>Callgrind</translation> - </message> - <message> - <source>Uses Perf when executing benchmarks (it must be installed).</source> - <translation>ベンチマーク実行時に Perf を用います(インストールが必要です)。</translation> - </message> - <message> - <source>Perf</source> - <translation>Perf</translation> - </message> - <message> <source>Test Settings</source> <translation>テスト設定</translation> </message> @@ -38958,66 +38918,20 @@ the program.</source> </message> </context> <context> - <name>Autotest::Internal::AutotestPlugin</name> - <message> - <source>&Tests</source> - <translation>テスト(&T)</translation> - </message> - <message> - <source>Run &All Tests</source> - <translation>すべてのテストの実行(&A)</translation> - </message> - <message> - <source>Alt+Shift+T,Alt+A</source> - <translation>Alt+Shift+T,Alt+A</translation> - </message> - <message> - <source>&Run Selected Tests</source> - <translation>選択したテストの実行(&R)</translation> - </message> - <message> - <source>Alt+Shift+T,Alt+R</source> - <translation>Alt+Shift+T,Alt+R</translation> - </message> - <message> - <source>Re&scan Tests</source> - <translation>テストの再スキャン(&S)</translation> - </message> - <message> - <source>Alt+Shift+T,Alt+S</source> - <translation>Alt+Shift+T,Alt+S</translation> - </message> -</context> -<context> - <name>Autotest::Internal::TestCodeParser</name> + <name>Autotest</name> <message> <source>Scanning for Tests</source> <translation>テストのスキャン中</translation> </message> -</context> -<context> - <name>Autotest::Internal::TestNavigationWidget</name> - <message> - <source>Tests</source> - <translation>テスト</translation> - </message> <message> <source>No active test frameworks.</source> <translation>有効なテストフレームワークが見つかりません。</translation> </message> <message> - <source>Run This Test</source> - <translation>このテストの実行</translation> - </message> - <message> <source>Run Without Deployment</source> <translation>デプロイせずに実行</translation> </message> <message> - <source>Debug This Test</source> - <translation>このテストのデバッグ</translation> - </message> - <message> <source>Debug Without Deployment</source> <translation>デプロイせずにデバッグ</translation> </message> @@ -39059,23 +38973,16 @@ the program.</source> </message> </context> <context> - <name>Autotest::Internal::TestNavigationWidgetFactory</name> + <name>Autotest</name> <message> <source>Tests</source> <translation>テスト</translation> </message> -</context> -<context> - <name>Autotest::Internal::QtTestOutputReader</name> <message> <source>%1 %2 per iteration (total: %3, iterations: %4)</source> <translation>%1 %2 毎実行 (トータル: %3, 実行回数: %4)</translation> </message> <message> - <source>Executing test case %1</source> - <translation>テストケース %1 を実行しています</translation> - </message> - <message> <source>Entering test function %1::%2</source> <translation>テスト関数 %1::%2 を実行しています</translation> </message> @@ -39103,9 +39010,6 @@ the program.</source> <source>Test execution took %1 ms.</source> <translation>テストの実行時間は %1 ミリ秒でした。</translation> </message> -</context> -<context> - <name>Autotest::Internal::GTestOutputReader</name> <message numerus="yes"> <source>You have %n disabled test(s).</source> <translation> @@ -39113,10 +39017,6 @@ the program.</source> </translation> </message> <message> - <source>Test execution took %1</source> - <translation>テストの実行時間: %1</translation> - </message> - <message> <source>Repeating test case %1 (iteration %2)</source> <translation>テストケース %1 を繰り返し実行中 (実行回数: %2)</translation> </message> @@ -39134,19 +39034,7 @@ the program.</source> </message> </context> <context> - <name>Autotest::Internal::TestResultsPane</name> - <message> - <source>Expand All</source> - <translation>すべて展開</translation> - </message> - <message> - <source>Run All Tests</source> - <translation>すべてのテストの実行</translation> - </message> - <message> - <source>Run Selected Tests</source> - <translation>選択したテストの実行</translation> - </message> + <name>Autotest</name> <message> <source>Stop Test Run</source> <translation>テスト実行の停止</translation> @@ -39265,7 +39153,7 @@ the program.</source> </message> </context> <context> - <name>Autotest::Internal::TestRunner</name> + <name>Autotest</name> <message> <source>Test run canceled by user.</source> <translation>テスト実行はユーザーによってキャンセルされました。</translation> @@ -46461,18 +46349,14 @@ Android パッケージソースディレクトリのファイルはビルドデ </message> </context> <context> - <name>Autotest::Internal::TestRunConfiguration</name> + <name>Autotest</name> <message> <source>AutoTest Debug</source> <translation>自動テストのデバッグ</translation> </message> </context> <context> - <name>Autotest::Internal::TestSettingsWidget</name> - <message> - <source>No active test frameworks.</source> - <translation>アクティブなテストフレームワークが見つかりません。</translation> - </message> + <name>Autotest</name> <message> <source>You will not be able to use the AutoTest plugin without having at least one active test framework.</source> <translation>有効なテストフレームワークが存在しないため、AutoTest プラグインを使用できません。</translation> @@ -47512,61 +47396,18 @@ Output: </message> </context> <context> - <name>BoostSettingsPage</name> + <name>Autotest</name> <message> <source>Seed:</source> <translation>シード:</translation> </message> -</context> -<context> - <name>Autotest::Internal::GTestSettingsPage</name> - <message> - <source>Executes disabled tests when performing a test run.</source> - <translation>テスト実行時に無効化されたテストも実行します。</translation> - </message> - <message> - <source>Run disabled tests</source> - <translation>無効化されたテストを実行する</translation> - </message> - <message> - <source>Iterations:</source> - <translation>実行回数:</translation> - </message> - <message> - <source>Shuffle tests</source> - <translation>テストをシャッフルする</translation> - </message> - <message> - <source>Repeats a test run (you might be required to increase the timeout to avoid canceling the tests).</source> - <translation>テストを繰り返し実行します(テストがキャンセルされないようにタイムアウトを長くする必要があるかもしれません)。</translation> - </message> - <message> - <source>Repeat tests</source> - <translation>テストを繰り返し実行する</translation> - </message> - <message> - <source>Seed:</source> - <translation>シード:</translation> - </message> - <message> - <source>A seed of 0 generates a seed based on the current timestamp.</source> - <translation>シードが 0 の場合、現在時刻からシードが生成されます。</translation> - </message> <message> <source>Directory</source> <translation>ディレクトリ</translation> </message> </context> <context> - <name>Autotest::Internal::QtTestSettingsPage</name> - <message> - <source>Benchmark Metrics</source> - <translation>ベンチマーク測定基準</translation> - </message> - <message> - <source>Uses walltime metrics for executing benchmarks (default).</source> - <translation>ベンチマーク実行時に待ち時間を基準に用います(既定)。</translation> - </message> + <name>Autotest</name> <message> <source>Walltime</source> <translation>総経過時間</translation> @@ -47580,10 +47421,6 @@ Output: <translation>チックカウンタ</translation> </message> <message> - <source>Uses event counter when executing benchmarks.</source> - <translation>ベンチマーク実行時にイベントカウンタを基準に用います。</translation> - </message> - <message> <source>Event counter</source> <translation>イベントカウンタ</translation> </message> @@ -49289,7 +49126,7 @@ Android パッケージソースディレクトリのファイルはビルドデ </message> </context> <context> - <name>Autotest::Internal::AutotestPluginPrivate</name> + <name>Autotest</name> <message> <source>Testing</source> <translation>自動テスト</translation> @@ -49387,7 +49224,7 @@ Android パッケージソースディレクトリのファイルはビルドデ </message> </context> <context> - <name>Autotest::Internal::BoostTestOutputReader</name> + <name>Autotest</name> <message> <source>Test execution took %1</source> <translation>テストの実行時間: %1</translation> @@ -49416,7 +49253,7 @@ Android パッケージソースディレクトリのファイルはビルドデ </message> </context> <context> - <name>Autotest::Internal::CatchOutputReader</name> + <name>Autotest</name> <message> <source>Executing %1 "%2"</source> <translation>実行中: %1 "%2"</translation> @@ -49457,7 +49294,7 @@ Android パッケージソースディレクトリのファイルはビルドデ </message> </context> <context> - <name>Autotest::Internal::CTestOutputReader</name> + <name>Autotest</name> <message> <source>Running tests for %1</source> <translation>%1のテストを実行中</translation> @@ -49471,7 +49308,7 @@ Android パッケージソースディレクトリのファイルはビルドデ </message> </context> <context> - <name>Autotest::Internal::ProjectTestSettingsWidget</name> + <name>Autotest</name> <message> <source>Global</source> <translation>グローバル</translation> @@ -49492,14 +49329,6 @@ Android パッケージソースディレクトリのファイルはビルドデ <source>None</source> <translation>なし</translation> </message> - <message> - <source>All</source> - <translation>すべて</translation> - </message> - <message> - <source>Selected</source> - <translation>選択した</translation> - </message> </context> <context> <name>QtTestTreeItem</name> @@ -49509,14 +49338,14 @@ Android パッケージソースディレクトリのファイルはビルドデ </message> </context> <context> - <name>Autotest::TestOutputReader</name> + <name>Autotest</name> <message> <source>Test executable crashed.</source> <translation>テストの実行ファイルがクラッシュしました。</translation> </message> </context> <context> - <name>Autotest::Internal::RunConfigurationSelectionDialog</name> + <name>Autotest</name> <message> <source>Select Run Configuration</source> <translation>実行構成を選択する</translation> diff --git a/share/qtcreator/translations/qtcreator_pl.ts b/share/qtcreator/translations/qtcreator_pl.ts index 4f2dc965d6..99db5c19c6 100644 --- a/share/qtcreator/translations/qtcreator_pl.ts +++ b/share/qtcreator/translations/qtcreator_pl.ts @@ -37290,11 +37290,7 @@ Te pliki są zabezpieczone.</numerusform> </message> </context> <context> - <name>Autotest::Internal::TestSettingsPage</name> - <message> - <source>Form</source> - <translation>Formularz</translation> - </message> + <name>Autotest</name> <message> <source>General</source> <translation>Ogólne</translation> @@ -37578,7 +37574,7 @@ Te pliki są zabezpieczone.</numerusform> </message> </context> <context> - <name>Autotest::Internal::AutotestPlugin</name> + <name>Autotest</name> <message> <source>&Tests</source> <translation>&Testy</translation> @@ -37609,7 +37605,7 @@ Te pliki są zabezpieczone.</numerusform> </message> </context> <context> - <name>Autotest::Internal::TestCodeParser</name> + <name>Autotest</name> <message> <source>AutoTest Plugin WARNING: No files left after filtering test scan folders. Check test filter settings.</source> <translation>Ostrzeżenie wtyczki AutoTest: Brak plików po przeskanowaniu przefiltrowanych katalogów z testami. Sprawdź ustawienia filtra testów.</translation> @@ -37620,16 +37616,12 @@ Te pliki są zabezpieczone.</numerusform> </message> </context> <context> - <name>Autotest::Internal::TestNavigationWidget</name> + <name>Autotest</name> <message> <source>Tests</source> <translation>Testy</translation> </message> <message> - <source>No active test frameworks.</source> - <translation>Brak aktywnych frameworków testowych.</translation> - </message> - <message> <source>Run This Test</source> <translation>Uruchom ten test</translation> </message> @@ -37683,14 +37675,7 @@ Te pliki są zabezpieczone.</numerusform> </message> </context> <context> - <name>Autotest::Internal::TestNavigationWidgetFactory</name> - <message> - <source>Tests</source> - <translation>Testy</translation> - </message> -</context> -<context> - <name>Autotest::Internal::QtTestOutputReader</name> + <name>Autotest</name> <message> <source>%1 %2 per iteration (total: %3, iterations: %4)</source> <translation>%1 %2 na iterację (w sumie: %3, ilość iteracji: %4)</translation> @@ -37737,7 +37722,7 @@ Te pliki są zabezpieczone.</numerusform> </message> </context> <context> - <name>Autotest::Internal::GTestOutputReader</name> + <name>Autotest</name> <message> <source>(iteration %1)</source> <translation>(iteracja %1)</translation> @@ -37759,10 +37744,6 @@ Te pliki są zabezpieczone.</numerusform> <translation>Powtarzanie wariantu testu %1 (iteracja %2)</translation> </message> <message> - <source>Executing test case %1</source> - <translation>Wykonywanie wariantu testu %1</translation> - </message> - <message> <source>Entering test set %1</source> <translation>Wejście do zestawu testów %1</translation> </message> @@ -37770,13 +37751,6 @@ Te pliki są zabezpieczone.</numerusform> <source>Execution took %1.</source> <translation>Wykonanie zajęło %1.</translation> </message> -</context> -<context> - <name>Autotest::Internal::TestResultsPane</name> - <message> - <source>Expand All</source> - <translation>Rozwiń wszystko</translation> - </message> <message> <source>Run All Tests</source> <translation>Uruchom wszystkie testy</translation> @@ -37900,7 +37874,7 @@ Te pliki są zabezpieczone.</numerusform> </message> </context> <context> - <name>Autotest::Internal::TestRunner</name> + <name>Autotest</name> <message> <source>Test run canceled by user.</source> <translation>Wykonywanie testów anulowane przez użytkownika.</translation> @@ -39395,14 +39369,14 @@ po naciśnięciu klawisza backspace</translation> </message> </context> <context> - <name>Autotest::Internal::TestRunConfiguration</name> + <name>Autotest</name> <message> <source>AutoTest Debug</source> <translation type="unfinished"></translation> </message> </context> <context> - <name>Autotest::Internal::TestSettingsWidget</name> + <name>Autotest</name> <message> <source>No active test frameworks.</source> <translation>Brak aktywnych frameworków testowych.</translation> @@ -40349,11 +40323,7 @@ w ścieżce.</translation> </message> </context> <context> - <name>Autotest::Internal::GTestSettingsPage</name> - <message> - <source>Form</source> - <translation>Formularz</translation> - </message> + <name>Autotest</name> <message> <source>Break on failure while debugging</source> <translation>Zatrzymuj na błędach podczas debugowania</translation> @@ -40408,7 +40378,7 @@ w ścieżce.</translation> </message> </context> <context> - <name>Autotest::Internal::QtTestSettingsPage</name> + <name>Autotest</name> <message> <source>Form</source> <translation>Formularz</translation> diff --git a/share/qtcreator/translations/qtcreator_ru.ts b/share/qtcreator/translations/qtcreator_ru.ts index c1c4eee7f8..2a15783365 100644 --- a/share/qtcreator/translations/qtcreator_ru.ts +++ b/share/qtcreator/translations/qtcreator_ru.ts @@ -2612,7 +2612,7 @@ To hide a sticky splash screen, invoke QtAndroid::hideSplashScreen().</source> </message> </context> <context> - <name>Autotest::Internal::AutotestPlugin</name> + <name>Autotest</name> <message> <source>&Run Test Under Cursor</source> <translation>&Запустить тест под курсором</translation> @@ -2623,7 +2623,7 @@ To hide a sticky splash screen, invoke QtAndroid::hideSplashScreen().</source> </message> </context> <context> - <name>Autotest::Internal::AutotestPluginPrivate</name> + <name>Autotest</name> <message> <source>Testing</source> <translation>Тестирование</translation> @@ -2698,19 +2698,7 @@ To hide a sticky splash screen, invoke QtAndroid::hideSplashScreen().</source> </message> </context> <context> - <name>Autotest::Internal::BoostTestOutputReader</name> - <message> - <source>Executing test case %1</source> - <translation>Выполнение теста %1</translation> - </message> - <message> - <source>Executing test suite %1</source> - <translation>Выполнение набора тестов %1</translation> - </message> - <message> - <source>Test execution took %1</source> - <translation>Выполнение теста заняло %1</translation> - </message> + <name>Autotest</name> <message> <source>Test suite execution took %1</source> <translation>Выполнение набора тестов заняло %1</translation> @@ -2757,7 +2745,7 @@ Executable: %2</source> </message> </context> <context> - <name>Autotest::Internal::CatchOutputReader</name> + <name>Autotest</name> <message> <source>Executing %1 "%2"</source> <translation>Выполнение %1 «%2»</translation> @@ -2780,7 +2768,7 @@ Executable: %2</source> </message> </context> <context> - <name>Autotest::Internal::GTestOutputReader</name> + <name>Autotest</name> <message> <source>Running tests failed. %1 @@ -2815,7 +2803,7 @@ Executable: %2</source> </message> </context> <context> - <name>Autotest::Internal::GTestSettingsPage</name> + <name>Autotest</name> <message> <source>Break on failure while debugging</source> <translation>Останавливаться при ошибках</translation> @@ -2896,7 +2884,7 @@ See Google Test documentation for further information on GTest filters.</source> </message> </context> <context> - <name>Autotest::Internal::ProjectTestSettingsWidget</name> + <name>Autotest</name> <message> <source>Global</source> <translation>Общие</translation> @@ -2927,7 +2915,7 @@ See Google Test documentation for further information on GTest filters.</source> </message> </context> <context> - <name>Autotest::Internal::QtTestOutputReader</name> + <name>Autotest</name> <message> <source>%1 %2 per iteration (total: %3, iterations: %4)</source> <translation>%1 %2 за итерацию (всего: %3, итераций: %4)</translation> @@ -2978,7 +2966,7 @@ See Google Test documentation for further information on GTest filters.</source> </message> </context> <context> - <name>Autotest::Internal::QtTestSettingsPage</name> + <name>Autotest</name> <message> <source>Enables interrupting tests on assertions.</source> <translation>Включение прерывания тестов на утверждениях.</translation> @@ -3057,7 +3045,7 @@ Warning: Plain text misses some information, such as duration.</source> </message> </context> <context> - <name>Autotest::Internal::RunConfigurationSelectionDialog</name> + <name>Autotest</name> <message> <source>Select Run Configuration</source> <translation>Выбор конфигурации запуска</translation> @@ -3088,26 +3076,14 @@ Warning: Plain text misses some information, such as duration.</source> </message> </context> <context> - <name>Autotest::Internal::TestCodeParser</name> + <name>Autotest</name> <message> <source>Scanning for Tests</source> <translation>Поиск тестов</translation> </message> </context> <context> - <name>Autotest::Internal::TestNavigationWidget</name> - <message> - <source>Tests</source> - <translation>Тесты</translation> - </message> - <message> - <source>No active test frameworks.</source> - <translation>Нет активной среды тестирования.</translation> - </message> - <message> - <source>Run This Test</source> - <translation>Запустить этот тест</translation> - </message> + <name>Autotest</name> <message> <source>Run Without Deployment</source> <translation>Запустить без развёртывания</translation> @@ -3137,10 +3113,6 @@ Warning: Plain text misses some information, such as duration.</source> <translation>Отсортировать по порядку</translation> </message> <message> - <source>Expand All</source> - <translation>Развернуть всё</translation> - </message> - <message> <source>Collapse All</source> <translation>Свернуть всё</translation> </message> @@ -3158,14 +3130,14 @@ Warning: Plain text misses some information, such as duration.</source> </message> </context> <context> - <name>Autotest::Internal::TestNavigationWidgetFactory</name> + <name>Autotest</name> <message> <source>Tests</source> <translation>Тесты</translation> </message> </context> <context> - <name>Autotest::Internal::TestResultsPane</name> + <name>Autotest</name> <message> <source>Expand All</source> <translation>Развернуть всё</translation> @@ -3283,10 +3255,6 @@ Warning: Plain text misses some information, such as duration.</source> <translation>Запустить этот тест</translation> </message> <message> - <source>Debug This Test</source> - <translation>Отладить этот тест</translation> - </message> - <message> <source>Save Output To</source> <translation>Сохранение вывода в</translation> </message> @@ -3304,14 +3272,14 @@ Warning: Plain text misses some information, such as duration.</source> </message> </context> <context> - <name>Autotest::Internal::TestRunConfiguration</name> + <name>Autotest</name> <message> <source>AutoTest Debug</source> <translation>Отладка автотеста</translation> </message> </context> <context> - <name>Autotest::Internal::TestRunner</name> + <name>Autotest</name> <message> <source>Test run canceled by user.</source> <translation>Тест прерван пользователем.</translation> @@ -3420,7 +3388,7 @@ This might cause trouble during execution. </message> </context> <context> - <name>Autotest::Internal::TestSettingsPage</name> + <name>Autotest</name> <message> <source>General</source> <translation>Основное</translation> @@ -3547,21 +3515,9 @@ Warning: this is an experimental feature and might lead to failing to execute th <source>Runs chosen tests automatically if a build succeeded.</source> <translation>Автоматически запускать выбранные тесты после успешной сборки.</translation> </message> - <message> - <source>None</source> - <translation>Нет</translation> - </message> - <message> - <source>All</source> - <translation>Всех</translation> - </message> - <message> - <source>Selected</source> - <translation>Выбранных</translation> - </message> </context> <context> - <name>Autotest::Internal::TestSettingsWidget</name> + <name>Autotest</name> <message> <source>No active test frameworks.</source> <translation>Нет активных сред тестирования.</translation> @@ -3580,7 +3536,7 @@ Warning: this is an experimental feature and might lead to failing to execute th </message> </context> <context> - <name>Autotest::TestOutputReader</name> + <name>Autotest</name> <message> <source>Test executable crashed.</source> <translation>Сбой программы тестирования.</translation> diff --git a/share/qtcreator/translations/qtcreator_uk.ts b/share/qtcreator/translations/qtcreator_uk.ts index 5cf1c375ec..9887a6d888 100644 --- a/share/qtcreator/translations/qtcreator_uk.ts +++ b/share/qtcreator/translations/qtcreator_uk.ts @@ -52080,7 +52080,7 @@ the program.</source> </message> </context> <context> - <name>Autotest::Internal::TestSettingsPage</name> + <name>Autotest</name> <message> <source>Form</source> <translation>Форма</translation> @@ -52515,14 +52515,14 @@ the program.</source> </message> </context> <context> - <name>Autotest::Constants</name> + <name>Autotest</name> <message> <source><unnamed></source> <translation><без назви></translation> </message> </context> <context> - <name>Autotest::Internal::AutotestPlugin</name> + <name>Autotest</name> <message> <source>&Tests</source> <translation>&Тести</translation> @@ -52553,14 +52553,14 @@ the program.</source> </message> </context> <context> - <name>Autotest::Internal::TestCodeParser</name> + <name>Autotest</name> <message> <source>Scanning for Tests</source> <translation>Пошук тестів</translation> </message> </context> <context> - <name>Autotest::Internal::TestNavigationWidget</name> + <name>Autotest</name> <message> <source>Tests</source> <translation>Тести</translation> @@ -52607,18 +52607,7 @@ the program.</source> </message> </context> <context> - <name>Autotest::Internal::TestNavigationWidgetFactory</name> - <message> - <source>Tests</source> - <translation>Тести</translation> - </message> -</context> -<context> - <name>Autotest::Internal::QtTestOutputReader</name> - <message> - <source>Executing test case %1</source> - <translation>Виконання тесту %1</translation> - </message> + <name>Autotest</name> <message> <source>Entering test function %1::%2</source> <translation>Входження до тестової функції %1::%2</translation> @@ -52649,7 +52638,7 @@ the program.</source> </message> </context> <context> - <name>Autotest::Internal::GTestOutputReader</name> + <name>Autotest</name> <message numerus="yes"> <source>You have %n disabled test(s).</source> <translation> @@ -52680,11 +52669,7 @@ the program.</source> </message> </context> <context> - <name>Autotest::Internal::TestResultsPane</name> - <message> - <source>Expand All</source> - <translation>Розгорнути все</translation> - </message> + <name>Autotest</name> <message> <source>Run All Tests</source> <translation>Виконати усі тести</translation> @@ -52803,7 +52788,7 @@ the program.</source> </message> </context> <context> - <name>Autotest::Internal::TestRunner</name> + <name>Autotest</name> <message> <source>Project's run configuration was guessed for "%1". This might cause trouble during execution.</source> @@ -52834,7 +52819,7 @@ Only desktop kits are supported. Make sure the currently active kit is a desktop </message> </context> <context> - <name>Autotest::Internal::TestTreeModel</name> + <name>Autotest</name> <message> <source>Auto Tests</source> <translation>Автотести</translation> diff --git a/src/plugins/autotest/autotestconstants.h b/src/plugins/autotest/autotestconstants.h index 6782ab2101..57ef559de0 100644 --- a/src/plugins/autotest/autotestconstants.h +++ b/src/plugins/autotest/autotestconstants.h @@ -48,7 +48,6 @@ const char TASK_INDEX[] = "AutoTest.Task.Index"; const char TASK_PARSE[] = "AutoTest.Task.Parse"; const char AUTOTEST_SETTINGS_CATEGORY[] = "ZY.Tests"; const char AUTOTEST_SETTINGS_ID[] = "A.AutoTest.0.General"; -const char AUTOTEST_SETTINGS_TR[] = QT_TRANSLATE_NOOP("AutoTest", "Testing"); const char FRAMEWORK_PREFIX[] = "AutoTest.Framework."; const char SETTINGSPAGE_PREFIX[] = "A.AutoTest."; const char SETTINGSGROUP[] = "Autotest"; diff --git a/src/plugins/autotest/autotestplugin.cpp b/src/plugins/autotest/autotestplugin.cpp index 7ac67a7780..e405bb022c 100644 --- a/src/plugins/autotest/autotestplugin.cpp +++ b/src/plugins/autotest/autotestplugin.cpp @@ -27,6 +27,7 @@ #include "autotestconstants.h" #include "autotesticons.h" +#include "autotesttr.h" #include "projectsettingswidget.h" #include "testcodeparser.h" #include "testframeworkmanager.h" @@ -154,7 +155,7 @@ AutotestPluginPrivate::AutotestPluginPrivate() auto panelFactory = new ProjectExplorer::ProjectPanelFactory(); panelFactory->setPriority(666); // panelFactory->setIcon(); // TODO ? - panelFactory->setDisplayName(tr("Testing")); + panelFactory->setDisplayName(Tr::tr("Testing")); panelFactory->setCreateWidgetFunction([](ProjectExplorer::Project *project) { return new ProjectTestSettingsWidget(project); }); @@ -205,77 +206,77 @@ TestProjectSettings *AutotestPlugin::projectSettings(ProjectExplorer::Project *p void AutotestPluginPrivate::initializeMenuEntries() { ActionContainer *menu = ActionManager::createMenu(Constants::MENU_ID); - menu->menu()->setTitle(tr("&Tests")); + menu->menu()->setTitle(Tr::tr("&Tests")); menu->setOnAllDisabledBehavior(ActionContainer::Show); - QAction *action = new QAction(tr("Run &All Tests"), this); + QAction *action = new QAction(Tr::tr("Run &All Tests"), this); action->setIcon(Utils::Icons::RUN_SMALL.icon()); - action->setToolTip(tr("Run All Tests")); + action->setToolTip(Tr::tr("Run All Tests")); Command *command = ActionManager::registerAction(action, Constants::ACTION_RUN_ALL_ID); command->setDefaultKeySequence( - QKeySequence(useMacShortcuts ? tr("Ctrl+Meta+T, Ctrl+Meta+A") : tr("Alt+Shift+T,Alt+A"))); + QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+Meta+T, Ctrl+Meta+A") : Tr::tr("Alt+Shift+T,Alt+A"))); connect(action, &QAction::triggered, std::bind(&AutotestPluginPrivate::onRunAllTriggered, this, TestRunMode::Run)); action->setEnabled(false); menu->addAction(command); - action = new QAction(tr("Run All Tests Without Deployment"), this); + action = new QAction(Tr::tr("Run All Tests Without Deployment"), this); action->setIcon(Utils::Icons::RUN_SMALL.icon()); - action->setToolTip(tr("Run All Tests Without Deployment")); + action->setToolTip(Tr::tr("Run All Tests Without Deployment")); command = ActionManager::registerAction(action, Constants::ACTION_RUN_ALL_NODEPLOY_ID); command->setDefaultKeySequence( - QKeySequence(useMacShortcuts ? tr("Ctrl+Meta+T, Ctrl+Meta+E") : tr("Alt+Shift+T,Alt+E"))); + QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+Meta+T, Ctrl+Meta+E") : Tr::tr("Alt+Shift+T,Alt+E"))); connect(action, &QAction::triggered, std::bind(&AutotestPluginPrivate::onRunAllTriggered, this, TestRunMode::RunWithoutDeploy)); action->setEnabled(false); menu->addAction(command); - action = new QAction(tr("&Run Selected Tests"), this); + action = new QAction(Tr::tr("&Run Selected Tests"), this); action->setIcon(Utils::Icons::RUN_SELECTED.icon()); - action->setToolTip(tr("Run Selected Tests")); + action->setToolTip(Tr::tr("Run Selected Tests")); command = ActionManager::registerAction(action, Constants::ACTION_RUN_SELECTED_ID); command->setDefaultKeySequence( - QKeySequence(useMacShortcuts ? tr("Ctrl+Meta+T, Ctrl+Meta+R") : tr("Alt+Shift+T,Alt+R"))); + QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+Meta+T, Ctrl+Meta+R") : Tr::tr("Alt+Shift+T,Alt+R"))); connect(action, &QAction::triggered, std::bind(&AutotestPluginPrivate::onRunSelectedTriggered, this, TestRunMode::Run)); action->setEnabled(false); menu->addAction(command); - action = new QAction(tr("&Run Selected Tests Without Deployment"), this); + action = new QAction(Tr::tr("&Run Selected Tests Without Deployment"), this); action->setIcon(Utils::Icons::RUN_SELECTED.icon()); - action->setToolTip(tr("Run Selected Tests")); + action->setToolTip(Tr::tr("Run Selected Tests")); command = ActionManager::registerAction(action, Constants::ACTION_RUN_SELECTED_NODEPLOY_ID); command->setDefaultKeySequence( - QKeySequence(useMacShortcuts ? tr("Ctrl+Meta+T, Ctrl+Meta+W") : tr("Alt+Shift+T,Alt+W"))); + QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+Meta+T, Ctrl+Meta+W") : Tr::tr("Alt+Shift+T,Alt+W"))); connect(action, &QAction::triggered, std::bind(&AutotestPluginPrivate::onRunSelectedTriggered, this, TestRunMode::RunWithoutDeploy)); action->setEnabled(false); menu->addAction(command); - action = new QAction(tr("Run &Failed Tests"), this); + action = new QAction(Tr::tr("Run &Failed Tests"), this); action->setIcon(Icons::RUN_FAILED.icon()); - action->setToolTip(tr("Run Failed Tests")); + action->setToolTip(Tr::tr("Run Failed Tests")); command = ActionManager::registerAction(action, Constants::ACTION_RUN_FAILED_ID); command->setDefaultKeySequence( - useMacShortcuts ? tr("Ctrl+Meta+T, Ctrl+Meta+F") : tr("Alt+Shift+T,Alt+F")); + useMacShortcuts ? Tr::tr("Ctrl+Meta+T, Ctrl+Meta+F") : Tr::tr("Alt+Shift+T,Alt+F")); connect(action, &QAction::triggered, this, &AutotestPluginPrivate::onRunFailedTriggered); action->setEnabled(false); menu->addAction(command); - action = new QAction(tr("Run Tests for &Current File"), this); + action = new QAction(Tr::tr("Run Tests for &Current File"), this); action->setIcon(Utils::Icons::RUN_FILE.icon()); - action->setToolTip(tr("Run Tests for Current File")); + action->setToolTip(Tr::tr("Run Tests for Current File")); command = ActionManager::registerAction(action, Constants::ACTION_RUN_FILE_ID); command->setDefaultKeySequence( - QKeySequence(useMacShortcuts ? tr("Ctrl+Meta+T, Ctrl+Meta+C") : tr("Alt+Shift+T,Alt+C"))); + QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+Meta+T, Ctrl+Meta+C") : Tr::tr("Alt+Shift+T,Alt+C"))); connect(action, &QAction::triggered, this, &AutotestPluginPrivate::onRunFileTriggered); action->setEnabled(false); menu->addAction(command); - action = new QAction(tr("Re&scan Tests"), this); + action = new QAction(Tr::tr("Re&scan Tests"), this); command = ActionManager::registerAction(action, Constants::ACTION_SCAN_ID); command->setDefaultKeySequence( - QKeySequence(useMacShortcuts ? tr("Ctrl+Meta+T, Ctrl+Meta+S") : tr("Alt+Shift+T,Alt+S"))); + QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+Meta+T, Ctrl+Meta+S") : Tr::tr("Alt+Shift+T,Alt+S"))); connect(action, &QAction::triggered, this, [] { dd->m_testCodeParser.updateTestTree(); }); menu->addAction(command); @@ -314,7 +315,7 @@ void AutotestPlugin::extensionsInitialized() if (!contextMenu) // if QC is started without CppEditor plugin return; - QAction *action = new QAction(tr("&Run Test Under Cursor"), this); + QAction *action = new QAction(Tr::tr("&Run Test Under Cursor"), this); action->setEnabled(false); action->setIcon(Utils::Icons::RUN_SMALL.icon()); @@ -324,7 +325,7 @@ void AutotestPlugin::extensionsInitialized() contextMenu->addSeparator(); contextMenu->addAction(command); - action = new QAction(tr("Run Test Under Cursor Without Deployment"), this); + action = new QAction(Tr::tr("Run Test Under Cursor Without Deployment"), this); action->setEnabled(false); action->setIcon(Utils::Icons::RUN_SMALL.icon()); @@ -333,7 +334,7 @@ void AutotestPlugin::extensionsInitialized() std::bind(&AutotestPluginPrivate::onRunUnderCursorTriggered, dd, TestRunMode::RunWithoutDeploy)); contextMenu->addAction(command); - action = new QAction(tr("&Debug Test Under Cursor"), this); + action = new QAction(Tr::tr("&Debug Test Under Cursor"), this); action->setEnabled(false); action->setIcon(ProjectExplorer::Icons::DEBUG_START_SMALL.icon()); @@ -342,7 +343,7 @@ void AutotestPlugin::extensionsInitialized() std::bind(&AutotestPluginPrivate::onRunUnderCursorTriggered, dd, TestRunMode::Debug)); contextMenu->addAction(command); - action = new QAction(tr("Debug Test Under Cursor Without Deployment"), this); + action = new QAction(Tr::tr("Debug Test Under Cursor Without Deployment"), this); action->setEnabled(false); action->setIcon(ProjectExplorer::Icons::DEBUG_START_SMALL.icon()); @@ -434,7 +435,7 @@ void AutotestPluginPrivate::onRunUnderCursorTriggered(TestRunMode mode) filteredItems.size() == 1 ? filteredItems : testsItems, mode); if (testsToRun.isEmpty()) { - MessageManager::writeFlashing(tr("Selected test was not found (%1).").arg(text)); + MessageManager::writeFlashing(Tr::tr("Selected test was not found (%1).").arg(text)); return; } diff --git a/src/plugins/autotest/autotesttr.h b/src/plugins/autotest/autotesttr.h index b0eaa31c86..41f2a3beb1 100644 --- a/src/plugins/autotest/autotesttr.h +++ b/src/plugins/autotest/autotesttr.h @@ -27,11 +27,11 @@ #include <QCoreApplication> -namespace AutoTest { +namespace Autotest { struct Tr { - Q_DECLARE_TR_FUNCTIONS(AutoTest) + Q_DECLARE_TR_FUNCTIONS(Autotest) }; -} // namespace AutoTest +} // namespace Autotest diff --git a/src/plugins/autotest/autotestunittests.cpp b/src/plugins/autotest/autotestunittests.cpp index ace72df533..887ebd39b6 100644 --- a/src/plugins/autotest/autotestunittests.cpp +++ b/src/plugins/autotest/autotestunittests.cpp @@ -24,10 +24,8 @@ ****************************************************************************/ #include "autotestunittests.h" -#include "autotestconstants.h" -#include "autotestplugin.h" + #include "testcodeparser.h" -#include "testsettings.h" #include "testtreemodel.h" #include <cppeditor/cppmodelmanager.h> diff --git a/src/plugins/autotest/boost/boosttestconfiguration.cpp b/src/plugins/autotest/boost/boosttestconfiguration.cpp index 556228bd65..38667c8be4 100644 --- a/src/plugins/autotest/boost/boosttestconfiguration.cpp +++ b/src/plugins/autotest/boost/boosttestconfiguration.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "boosttestconfiguration.h" -#include "boosttestconstants.h" + #include "boosttestoutputreader.h" #include "boosttestsettings.h" diff --git a/src/plugins/autotest/boost/boosttestconstants.h b/src/plugins/autotest/boost/boosttestconstants.h index 2c993c1d4f..91bfabd770 100644 --- a/src/plugins/autotest/boost/boosttestconstants.h +++ b/src/plugins/autotest/boost/boosttestconstants.h @@ -32,7 +32,7 @@ namespace BoostTest { namespace Constants { const char FRAMEWORK_NAME[] = "Boost"; -const char FRAMEWORK_SETTINGS_CATEGORY[] = QT_TRANSLATE_NOOP("BoostTestFramework", "Boost Test"); +const char FRAMEWORK_SETTINGS_CATEGORY[] = QT_TRANSLATE_NOOP("Autotest", "Boost Test"); const unsigned FRAMEWORK_PRIORITY = 11; const char BOOST_MASTER_SUITE[] = "Master Test Suite"; diff --git a/src/plugins/autotest/boost/boosttestframework.cpp b/src/plugins/autotest/boost/boosttestframework.cpp index 2b9b4837b8..17e07f0cb3 100644 --- a/src/plugins/autotest/boost/boosttestframework.cpp +++ b/src/plugins/autotest/boost/boosttestframework.cpp @@ -24,10 +24,11 @@ ****************************************************************************/ #include "boosttestframework.h" + #include "boosttestconstants.h" #include "boosttesttreeitem.h" #include "boosttestparser.h" -#include "../testframeworkmanager.h" +#include "../autotesttr.h" namespace Autotest { namespace Internal { @@ -52,8 +53,7 @@ const char *BoostTestFramework::name() const QString BoostTestFramework::displayName() const { - return QCoreApplication::translate("BoostTestFramework", - BoostTest::Constants::FRAMEWORK_SETTINGS_CATEGORY); + return Tr::tr(BoostTest::Constants::FRAMEWORK_SETTINGS_CATEGORY); } unsigned BoostTestFramework::priority() const diff --git a/src/plugins/autotest/boost/boosttestoutputreader.cpp b/src/plugins/autotest/boost/boosttestoutputreader.cpp index b87f9ab764..68797cec7c 100644 --- a/src/plugins/autotest/boost/boosttestoutputreader.cpp +++ b/src/plugins/autotest/boost/boosttestoutputreader.cpp @@ -24,15 +24,15 @@ ****************************************************************************/ #include "boosttestoutputreader.h" + #include "boosttestsettings.h" #include "boosttestresult.h" -#include "boosttesttreeitem.h" +#include "../autotesttr.h" +#include "../testtreeitem.h" #include <utils/qtcassert.h> #include <utils/qtcprocess.h> -#include <QDir> -#include <QFileInfo> #include <QLoggingCategory> #include <QRegularExpression> @@ -150,14 +150,14 @@ void BoostTestOutputReader::handleMessageMatch(const QRegularExpressionMatch &ma const QString type = match.captured(8); if (type == "case") { m_currentTest = match.captured(9); - m_description = tr("Executing test case %1").arg(m_currentTest); + m_description = Tr::tr("Executing test case %1").arg(m_currentTest); } else if (type == "suite") { if (m_currentSuite.isEmpty()) m_currentSuite = match.captured(9); else m_currentSuite.append("/").append(match.captured(9)); m_currentTest.clear(); - m_description = tr("Executing test suite %1").arg(m_currentSuite); + m_description = Tr::tr("Executing test suite %1").arg(m_currentSuite); } } else if (content.startsWith("Leaving")) { const QString type = match.captured(10); @@ -165,7 +165,7 @@ void BoostTestOutputReader::handleMessageMatch(const QRegularExpressionMatch &ma if (m_currentTest != match.captured(11) && m_currentTest.isEmpty()) m_currentTest = match.captured(11); m_result = ResultType::TestEnd; - m_description = tr("Test execution took %1").arg(match.captured(12)); + m_description = Tr::tr("Test execution took %1").arg(match.captured(12)); } else if (type == "suite") { if (!m_currentSuite.isEmpty()) { int index = m_currentSuite.lastIndexOf('/'); @@ -181,7 +181,7 @@ void BoostTestOutputReader::handleMessageMatch(const QRegularExpressionMatch &ma } m_currentTest.clear(); m_result = ResultType::TestEnd; - m_description = tr("Test suite execution took %1").arg(match.captured(12)); + m_description = Tr::tr("Test suite execution took %1").arg(match.captured(12)); } } else if (content.startsWith("Test case ")) { m_currentTest = match.captured(4); @@ -258,14 +258,14 @@ void BoostTestOutputReader::processOutputLine(const QByteArray &outputLine) if (match.captured(1).startsWith("Entering")) { m_currentModule = match.captured(2); BoostTestResult *result = new BoostTestResult(id(), m_projectFile, m_currentModule); - result->setDescription(tr("Executing test module %1").arg(m_currentModule)); + result->setDescription(Tr::tr("Executing test module %1").arg(m_currentModule)); result->setResult(ResultType::TestStart); reportResult(TestResultPtr(result)); m_description.clear(); } else { QTC_CHECK(m_currentModule == match.captured(3)); BoostTestResult *result = new BoostTestResult(id(), m_projectFile, m_currentModule); - result->setDescription(tr("Test module execution took %1").arg(match.captured(4))); + result->setDescription(Tr::tr("Test module execution took %1").arg(match.captured(4))); result->setResult(ResultType::TestEnd); reportResult(TestResultPtr(result)); @@ -351,10 +351,10 @@ void BoostTestOutputReader::processOutputLine(const QByteArray &outputLine) BoostTestResult *result = new BoostTestResult(id(), m_projectFile, QString()); int failed = match.captured(1).toInt(); int fatals = m_summary.value(ResultType::MessageFatal); - QString txt = tr("%1 failures detected in %2.").arg(failed).arg(match.captured(3)); + QString txt = Tr::tr("%1 failures detected in %2.").arg(failed).arg(match.captured(3)); int passed = qMax(0, m_testCaseCount - failed); if (m_testCaseCount != -1) - txt.append(' ').append(tr("%1 tests passed.").arg(passed)); + txt.append(' ').append(Tr::tr("%1 tests passed.").arg(passed)); result->setDescription(txt); result->setResult(ResultType::MessageInfo); reportResult(TestResultPtr(result)); @@ -370,9 +370,9 @@ void BoostTestOutputReader::processOutputLine(const QByteArray &outputLine) if (m_result != ResultType::Invalid) sendCompleteInformation(); BoostTestResult *result = new BoostTestResult(id(), m_projectFile, QString()); - QString txt = tr("No errors detected."); + QString txt = Tr::tr("No errors detected."); if (m_testCaseCount != -1) - txt.append(' ').append(tr("%1 tests passed.").arg(m_testCaseCount)); + txt.append(' ').append(Tr::tr("%1 tests passed.").arg(m_testCaseCount)); result->setDescription(txt); result->setResult(ResultType::MessageInfo); reportResult(TestResultPtr(result)); @@ -416,25 +416,25 @@ void BoostTestOutputReader::onDone() { if (m_logLevel == LogLevel::Nothing && m_reportLevel == ReportLevel::No) { switch (exitCode) { case 0: - reportNoOutputFinish(tr("Running tests exited with %1").arg("boost::exit_success."), + reportNoOutputFinish(Tr::tr("Running tests exited with %1").arg("boost::exit_success."), ResultType::Pass); break; case 200: reportNoOutputFinish( - tr("Running tests exited with %1").arg("boost::exit_test_exception."), + Tr::tr("Running tests exited with %1").arg("boost::exit_test_exception."), ResultType::MessageFatal); break; case 201: - reportNoOutputFinish(tr("Running tests exited with %1") + reportNoOutputFinish(Tr::tr("Running tests exited with %1") .arg("boost::exit_test_failure."), ResultType::Fail); break; } } else if (exitCode != 0 && exitCode != 201 && !m_description.isEmpty()) { if (m_description.startsWith("Test setup error:")) { - createAndReportResult(m_description + '\n' + tr("Executable: %1") + createAndReportResult(m_description + '\n' + Tr::tr("Executable: %1") .arg(id()), ResultType::MessageWarn); } else { - createAndReportResult(tr("Running tests failed.\n%1\nExecutable: %2") + createAndReportResult(Tr::tr("Running tests failed.\n%1\nExecutable: %2") .arg(m_description).arg(id()), ResultType::MessageFatal); } } @@ -443,7 +443,7 @@ void BoostTestOutputReader::onDone() { void BoostTestOutputReader::reportNoOutputFinish(const QString &description, ResultType type) { BoostTestResult *result = new BoostTestResult(id(), m_projectFile, m_currentModule); - result->setTestCase(tr("Running tests without output.")); + result->setTestCase(Tr::tr("Running tests without output.")); result->setDescription(description); result->setResult(type); reportResult(TestResultPtr(result)); diff --git a/src/plugins/autotest/boost/boosttestparser.cpp b/src/plugins/autotest/boost/boosttestparser.cpp index 45c5ecbe94..d5c0a4e773 100644 --- a/src/plugins/autotest/boost/boosttestparser.cpp +++ b/src/plugins/autotest/boost/boosttestparser.cpp @@ -24,8 +24,8 @@ ****************************************************************************/ #include "boosttestparser.h" + #include "boostcodeparser.h" -#include "boosttestframework.h" #include "boosttesttreeitem.h" #include <cppeditor/cppmodelmanager.h> diff --git a/src/plugins/autotest/boost/boosttestsettings.cpp b/src/plugins/autotest/boost/boosttestsettings.cpp index c70c1c1308..e6c5e92b25 100644 --- a/src/plugins/autotest/boost/boosttestsettings.cpp +++ b/src/plugins/autotest/boost/boosttestsettings.cpp @@ -28,6 +28,7 @@ #include "boosttestconstants.h" #include "../autotestconstants.h" +#include "../autotesttr.h" #include <utils/layoutbuilder.h> @@ -56,7 +57,7 @@ BoostTestSettings::BoostTestSettings() logLevel.addOption("Fatal Error"); logLevel.addOption("Nothing"); logLevel.setDefaultValue(int(LogLevel::Warning)); - logLevel.setLabelText(tr("Log format:")); + logLevel.setLabelText(Tr::tr("Log format:")); registerAspect(&reportLevel); reportLevel.setSettingsKey("ReportLevel"); @@ -66,48 +67,47 @@ BoostTestSettings::BoostTestSettings() reportLevel.addOption("Detailed"); reportLevel.addOption("No"); reportLevel.setDefaultValue(int(ReportLevel::Confirm)); - reportLevel.setLabelText(tr("Report level:")); + reportLevel.setLabelText(Tr::tr("Report level:")); registerAspect(&seed); seed.setSettingsKey("Seed"); seed.setEnabled(false); - seed.setLabelText(tr("Seed:")); - seed.setToolTip(tr("A seed of 0 means no randomization. A value of 1 uses the current " + seed.setLabelText(Tr::tr("Seed:")); + seed.setToolTip(Tr::tr("A seed of 0 means no randomization. A value of 1 uses the current " "time, any other value is used as random seed generator.")); seed.setEnabler(&randomize); registerAspect(&randomize); randomize.setSettingsKey("Randomize"); randomize.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); - randomize.setLabelText(tr("Randomize")); - randomize.setToolTip(tr("Randomize execution order.")); + randomize.setLabelText(Tr::tr("Randomize")); + randomize.setToolTip(Tr::tr("Randomize execution order.")); registerAspect(&systemErrors); systemErrors.setSettingsKey("SystemErrors"); systemErrors.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); - systemErrors.setLabelText(tr("Catch system errors")); - systemErrors.setToolTip(tr("Catch or ignore system errors.")); + systemErrors.setLabelText(Tr::tr("Catch system errors")); + systemErrors.setToolTip(Tr::tr("Catch or ignore system errors.")); registerAspect(&fpExceptions); fpExceptions.setSettingsKey("FPExceptions"); fpExceptions.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); - fpExceptions.setLabelText(tr("Floating point exceptions")); - fpExceptions.setToolTip(tr("Enable floating point exception traps.")); + fpExceptions.setLabelText(Tr::tr("Floating point exceptions")); + fpExceptions.setToolTip(Tr::tr("Enable floating point exception traps.")); registerAspect(&memLeaks); memLeaks.setSettingsKey("MemoryLeaks"); memLeaks.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel); memLeaks.setDefaultValue(true); - memLeaks.setLabelText(tr("Detect memory leaks")); - memLeaks.setToolTip(tr("Enable memory leak detection.")); + memLeaks.setLabelText(Tr::tr("Detect memory leaks")); + memLeaks.setToolTip(Tr::tr("Enable memory leak detection.")); } BoostTestSettingsPage::BoostTestSettingsPage(BoostTestSettings *settings, Utils::Id settingsId) { setId(settingsId); setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); - setDisplayName(QCoreApplication::translate("BoostTestFramework", - BoostTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); + setDisplayName(Tr::tr(BoostTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); setSettings(settings); setLayouter([settings](QWidget *widget) { diff --git a/src/plugins/autotest/boost/boosttestsettings.h b/src/plugins/autotest/boost/boosttestsettings.h index 15f55483a2..f65c255a86 100644 --- a/src/plugins/autotest/boost/boosttestsettings.h +++ b/src/plugins/autotest/boost/boosttestsettings.h @@ -57,8 +57,6 @@ enum class ReportLevel class BoostTestSettings : public Utils::AspectContainer { - Q_DECLARE_TR_FUNCTIONS(Autotest::Internal::BoostTestSettings) - public: BoostTestSettings(); diff --git a/src/plugins/autotest/boost/boosttesttreeitem.cpp b/src/plugins/autotest/boost/boosttesttreeitem.cpp index 78878f8b3f..a9de381a7f 100644 --- a/src/plugins/autotest/boost/boosttesttreeitem.cpp +++ b/src/plugins/autotest/boost/boosttesttreeitem.cpp @@ -24,17 +24,18 @@ ****************************************************************************/ #include "boosttesttreeitem.h" + #include "boosttestconstants.h" #include "boosttestconfiguration.h" -#include "boosttestframework.h" #include "boosttestparser.h" -#include "../testframeworkmanager.h" + +#include "../autotesttr.h" +#include "../itestframework.h" #include <cppeditor/cppmodelmanager.h> #include <projectexplorer/session.h> #include <utils/qtcassert.h> -#include <QFileInfo> #include <QRegularExpression> namespace Autotest { @@ -333,9 +334,8 @@ ITestConfiguration *BoostTestTreeItem::debugConfiguration() const QString BoostTestTreeItem::nameSuffix() const { - static QString markups[] = {QCoreApplication::translate("BoostTestTreeItem", "parameterized"), - QCoreApplication::translate("BoostTestTreeItem", "fixture"), - QCoreApplication::translate("BoostTestTreeItem", "templated")}; + static QString markups[] = {Tr::tr("parameterized"), Tr::tr("fixture"), Tr::tr("templated")}; + QString suffix; if (m_state & Parameterized) suffix = QString(" [") + markups[0]; diff --git a/src/plugins/autotest/catch/catchframework.cpp b/src/plugins/autotest/catch/catchframework.cpp index defa59b10d..1edfad861e 100644 --- a/src/plugins/autotest/catch/catchframework.cpp +++ b/src/plugins/autotest/catch/catchframework.cpp @@ -26,6 +26,7 @@ #include "catchtestparser.h" #include "catchtreeitem.h" +#include "../autotesttr.h" namespace Autotest { namespace Internal { @@ -37,7 +38,7 @@ const char *CatchFramework::name() const QString CatchFramework::displayName() const { - return QCoreApplication::translate("CatchFramework", "Catch Test"); + return Tr::tr("Catch Test"); } unsigned CatchFramework::priority() const diff --git a/src/plugins/autotest/catch/catchoutputreader.cpp b/src/plugins/autotest/catch/catchoutputreader.cpp index f788aea017..9324d86299 100644 --- a/src/plugins/autotest/catch/catchoutputreader.cpp +++ b/src/plugins/autotest/catch/catchoutputreader.cpp @@ -25,13 +25,12 @@ #include "catchoutputreader.h" #include "catchresult.h" +#include "../autotesttr.h" #include "../testtreeitem.h" #include <utils/fileutils.h> #include <utils/qtcassert.h> -#include <QFileInfo> - namespace Autotest { namespace Internal { @@ -245,28 +244,28 @@ void CatchOutputReader::sendResult(const ResultType result) catchResult->setResult(result); if (result == ResultType::TestStart && m_testCaseInfo.size() > 0) { - catchResult->setDescription(tr("Executing %1 \"%2\"").arg(testOutputNodeToString().toLower()) + catchResult->setDescription(Tr::tr("Executing %1 \"%2\"").arg(testOutputNodeToString().toLower()) .arg(catchResult->description())); } else if (result == ResultType::Pass || result == ResultType::UnexpectedPass) { if (result == ResultType::UnexpectedPass) ++m_xpassCount; if (m_currentExpression.isEmpty()) { - catchResult->setDescription(tr("%1 \"%2\" passed").arg(testOutputNodeToString()) + catchResult->setDescription(Tr::tr("%1 \"%2\" passed").arg(testOutputNodeToString()) .arg(catchResult->description())); } else { - catchResult->setDescription(tr("Expression passed") + catchResult->setDescription(Tr::tr("Expression passed") .append('\n').append(m_currentExpression)); } m_reportedSectionResult = true; m_reportedResult = true; } else if (result == ResultType::Fail || result == ResultType::ExpectedFail) { - catchResult->setDescription(tr("Expression failed: %1").arg(m_currentExpression.trimmed())); + catchResult->setDescription(Tr::tr("Expression failed: %1").arg(m_currentExpression.trimmed())); if (!m_reportedSectionResult) m_reportedSectionResult = true; m_reportedResult = true; } else if (result == ResultType::TestEnd) { - catchResult->setDescription(tr("Finished executing %1 \"%2\"").arg(testOutputNodeToString().toLower()) + catchResult->setDescription(Tr::tr("Finished executing %1 \"%2\"").arg(testOutputNodeToString().toLower()) .arg(catchResult->description())); } else if (result == ResultType::Benchmark) { catchResult->setDescription(m_currentExpression); diff --git a/src/plugins/autotest/catch/catchoutputreader.h b/src/plugins/autotest/catch/catchoutputreader.h index 86c3acbb03..c438a2db3c 100644 --- a/src/plugins/autotest/catch/catchoutputreader.h +++ b/src/plugins/autotest/catch/catchoutputreader.h @@ -26,7 +26,6 @@ #include "../testoutputreader.h" -#include <QCoreApplication> #include <QStack> #include <QXmlStreamReader> @@ -35,8 +34,6 @@ namespace Internal { class CatchOutputReader : public TestOutputReader { - Q_DECLARE_TR_FUNCTIONS(Autotest::Internal::CatchOutputReader) - public: CatchOutputReader(const QFutureInterface<TestResultPtr> &futureInterface, Utils::QtcProcess *testApplication, const Utils::FilePath &buildDirectory, diff --git a/src/plugins/autotest/catch/catchtestsettings.cpp b/src/plugins/autotest/catch/catchtestsettings.cpp index 28d09590ec..60c8390c1f 100644 --- a/src/plugins/autotest/catch/catchtestsettings.cpp +++ b/src/plugins/autotest/catch/catchtestsettings.cpp @@ -26,6 +26,7 @@ #include "catchtestsettings.h" #include "../autotestconstants.h" +#include "../autotesttr.h" #include <coreplugin/icore.h> @@ -56,7 +57,7 @@ CatchTestSettings::CatchTestSettings() benchmarkResamples.setSettingsKey("BenchResamples"); benchmarkResamples.setRange(1, 9999999); benchmarkResamples.setDefaultValue(100000); - benchmarkResamples.setToolTip(tr("Number of resamples for bootstrapping.")); + benchmarkResamples.setToolTip(Tr::tr("Number of resamples for bootstrapping.")); benchmarkResamples.setEnabler(&resamplesChecked); registerAspect(&confidenceInterval); @@ -68,65 +69,65 @@ CatchTestSettings::CatchTestSettings() registerAspect(&benchmarkWarmupTime); benchmarkWarmupTime.setSettingsKey("BenchWarmup"); - benchmarkWarmupTime.setSuffix(tr(" ms")); + benchmarkWarmupTime.setSuffix(Tr::tr(" ms")); benchmarkWarmupTime.setRange(0, 10000); benchmarkWarmupTime.setEnabler(&warmupChecked); registerAspect(&abortAfterChecked); abortAfterChecked.setSettingsKey("AbortChecked"); - abortAfterChecked.setLabelText(tr("Abort after")); - abortAfterChecked.setToolTip(tr("Aborts after the specified number of failures.")); + abortAfterChecked.setLabelText(Tr::tr("Abort after")); + abortAfterChecked.setToolTip(Tr::tr("Aborts after the specified number of failures.")); registerAspect(&samplesChecked); samplesChecked.setSettingsKey("SamplesChecked"); - samplesChecked.setLabelText(tr("Benchmark samples")); - samplesChecked.setToolTip(tr("Number of samples to collect while running benchmarks.")); + samplesChecked.setLabelText(Tr::tr("Benchmark samples")); + samplesChecked.setToolTip(Tr::tr("Number of samples to collect while running benchmarks.")); registerAspect(&resamplesChecked); resamplesChecked.setSettingsKey("ResamplesChecked"); - resamplesChecked.setLabelText(tr("Benchmark resamples")); - resamplesChecked.setToolTip(tr("Number of resamples used for statistical bootstrapping.")); + resamplesChecked.setLabelText(Tr::tr("Benchmark resamples")); + resamplesChecked.setToolTip(Tr::tr("Number of resamples used for statistical bootstrapping.")); registerAspect(&confidenceIntervalChecked); confidenceIntervalChecked.setSettingsKey("ConfIntChecked"); - confidenceIntervalChecked.setToolTip(tr("Confidence interval used for statistical bootstrapping.")); - confidenceIntervalChecked.setLabelText(tr("Benchmark confidence interval")); + confidenceIntervalChecked.setToolTip(Tr::tr("Confidence interval used for statistical bootstrapping.")); + confidenceIntervalChecked.setLabelText(Tr::tr("Benchmark confidence interval")); registerAspect(&warmupChecked); warmupChecked.setSettingsKey("WarmupChecked"); - warmupChecked.setLabelText(tr("Benchmark warmup time")); - warmupChecked.setToolTip(tr("Warmup time for each test.")); + warmupChecked.setLabelText(Tr::tr("Benchmark warmup time")); + warmupChecked.setToolTip(Tr::tr("Warmup time for each test.")); registerAspect(&noAnalysis); noAnalysis.setSettingsKey("NoAnalysis"); - noAnalysis.setLabelText(tr("Disable analysis")); - noAnalysis.setToolTip(tr("Disables statistical analysis and bootstrapping.")); + noAnalysis.setLabelText(Tr::tr("Disable analysis")); + noAnalysis.setToolTip(Tr::tr("Disables statistical analysis and bootstrapping.")); registerAspect(&showSuccess); showSuccess.setSettingsKey("ShowSuccess"); - showSuccess.setLabelText(tr("Show success")); - showSuccess.setToolTip(tr("Show success for tests.")); + showSuccess.setLabelText(Tr::tr("Show success")); + showSuccess.setToolTip(Tr::tr("Show success for tests.")); registerAspect(&breakOnFailure); breakOnFailure.setSettingsKey("BreakOnFailure"); breakOnFailure.setDefaultValue(true); - breakOnFailure.setLabelText(tr("Break on failure while debugging")); - breakOnFailure.setToolTip(tr("Turns failures into debugger breakpoints.")); + breakOnFailure.setLabelText(Tr::tr("Break on failure while debugging")); + breakOnFailure.setToolTip(Tr::tr("Turns failures into debugger breakpoints.")); registerAspect(&noThrow); noThrow.setSettingsKey("NoThrow"); - noThrow.setLabelText(tr("Skip throwing assertions")); - noThrow.setToolTip(tr("Skips all assertions that test for thrown exceptions.")); + noThrow.setLabelText(Tr::tr("Skip throwing assertions")); + noThrow.setToolTip(Tr::tr("Skips all assertions that test for thrown exceptions.")); registerAspect(&visibleWhitespace); visibleWhitespace.setSettingsKey("VisibleWS"); - visibleWhitespace.setLabelText(tr("Visualize whitespace")); - visibleWhitespace.setToolTip(tr("Makes whitespace visible.")); + visibleWhitespace.setLabelText(Tr::tr("Visualize whitespace")); + visibleWhitespace.setToolTip(Tr::tr("Makes whitespace visible.")); registerAspect(&warnOnEmpty); warnOnEmpty.setSettingsKey("WarnEmpty"); - warnOnEmpty.setLabelText(tr("Warn on empty tests")); - warnOnEmpty.setToolTip(tr("Warns if a test section does not check any assertion.")); + warnOnEmpty.setLabelText(Tr::tr("Warn on empty tests")); + warnOnEmpty.setToolTip(Tr::tr("Warns if a test section does not check any assertion.")); forEachAspect([](BaseAspect *aspect) { // FIXME: Make the positioning part of the LayoutBuilder later @@ -139,7 +140,7 @@ CatchTestSettingsPage::CatchTestSettingsPage(CatchTestSettings *settings, Utils: { setId(settingsId); setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); - setDisplayName(QCoreApplication::translate("CatchTestFramework", "Catch Test")); + setDisplayName(Tr::tr("Catch Test")); setSettings(settings); setLayouter([settings](QWidget *widget) { diff --git a/src/plugins/autotest/catch/catchtestsettings.h b/src/plugins/autotest/catch/catchtestsettings.h index 79498edd7a..bd2e50e571 100644 --- a/src/plugins/autotest/catch/catchtestsettings.h +++ b/src/plugins/autotest/catch/catchtestsettings.h @@ -34,8 +34,6 @@ namespace Internal { class CatchTestSettings : public Utils::AspectContainer { - Q_DECLARE_TR_FUNCTIONS(Autotest::Internal::CatchTestSettings) - public: CatchTestSettings(); diff --git a/src/plugins/autotest/catch/catchtreeitem.cpp b/src/plugins/autotest/catch/catchtreeitem.cpp index 462f03dba8..2c2b55f01d 100644 --- a/src/plugins/autotest/catch/catchtreeitem.cpp +++ b/src/plugins/autotest/catch/catchtreeitem.cpp @@ -23,9 +23,12 @@ ****************************************************************************/ #include "catchtreeitem.h" -#include "catchtestparser.h" + #include "catchconfiguration.h" -#include "catchframework.h" +#include "../autotesttr.h" +#include "../testtreeitem.h" +#include "../itestparser.h" +#include "../itestframework.h" #include <cppeditor/cppmodelmanager.h> #include <projectexplorer/project.h> @@ -321,9 +324,9 @@ QString CatchTreeItem::stateSuffix() const { QStringList types; if (m_state & CatchTreeItem::Parameterized) - types.append(QCoreApplication::translate("CatchTreeItem", "parameterized")); + types.append(Tr::tr("parameterized")); if (m_state & CatchTreeItem::Fixture) - types.append(QCoreApplication::translate("CatchTreeItem", "fixture")); + types.append(Tr::tr("fixture")); return types.isEmpty() ? QString() : QString(" [" + types.join(", ") + ']'); } diff --git a/src/plugins/autotest/ctest/ctestoutputreader.cpp b/src/plugins/autotest/ctest/ctestoutputreader.cpp index e9bd1f465d..7192b1232d 100644 --- a/src/plugins/autotest/ctest/ctestoutputreader.cpp +++ b/src/plugins/autotest/ctest/ctestoutputreader.cpp @@ -25,6 +25,7 @@ #include "ctestoutputreader.h" #include "ctesttreeitem.h" +#include "../autotesttr.h" #include "../testframeworkmanager.h" #include "../testresult.h" @@ -111,7 +112,7 @@ void CTestOutputReader::processOutputLine(const QByteArray &outputLine) m_project = match.captured(1); TestResultPtr testResult = createDefaultResult(); testResult->setResult(ResultType::TestStart); - testResult->setDescription(tr("Running tests for %1").arg(m_project)); + testResult->setDescription(Tr::tr("Running tests for %1").arg(m_project)); reportResult(testResult); } else if (ExactMatch match = testCase1.match(line)) { int current = match.captured("current").toInt(); diff --git a/src/plugins/autotest/ctest/ctestoutputreader.h b/src/plugins/autotest/ctest/ctestoutputreader.h index 205325fe1f..cca055e178 100644 --- a/src/plugins/autotest/ctest/ctestoutputreader.h +++ b/src/plugins/autotest/ctest/ctestoutputreader.h @@ -26,8 +26,6 @@ #include "../testoutputreader.h" -#include <QCoreApplication> - namespace Utils { class QtcProcess; } namespace Autotest { @@ -35,7 +33,6 @@ namespace Internal { class CTestOutputReader final : public Autotest::TestOutputReader { - Q_DECLARE_TR_FUNCTIONS(Autotest::Internal::CTestOutputReader) public: CTestOutputReader(const QFutureInterface<TestResultPtr> &futureInterface, Utils::QtcProcess *testApplication, const Utils::FilePath &buildDirectory); diff --git a/src/plugins/autotest/ctest/ctestsettings.cpp b/src/plugins/autotest/ctest/ctestsettings.cpp index 64c1c834e0..5fe1b7f50d 100644 --- a/src/plugins/autotest/ctest/ctestsettings.cpp +++ b/src/plugins/autotest/ctest/ctestsettings.cpp @@ -26,6 +26,7 @@ #include "ctestsettings.h" #include "../autotestconstants.h" +#include "../autotesttr.h" #include <utils/layoutbuilder.h> @@ -39,30 +40,30 @@ CTestSettings::CTestSettings() registerAspect(&outputOnFail); outputOnFail.setSettingsKey("OutputOnFail"); - outputOnFail.setLabelText(tr("Output on failure")); + outputOnFail.setLabelText(Tr::tr("Output on failure")); outputOnFail.setDefaultValue(true); registerAspect(&outputMode); outputMode.setSettingsKey("OutputMode"); - outputMode.setLabelText(tr("Output mode")); + outputMode.setLabelText(Tr::tr("Output mode")); outputMode.setDisplayStyle(Utils::SelectionAspect::DisplayStyle::ComboBox); - outputMode.addOption({tr("Default"), {}, 0}); - outputMode.addOption({tr("Verbose"), {}, 1}); - outputMode.addOption({tr("Very Verbose"), {}, 2}); + outputMode.addOption({Tr::tr("Default"), {}, 0}); + outputMode.addOption({Tr::tr("Verbose"), {}, 1}); + outputMode.addOption({Tr::tr("Very Verbose"), {}, 2}); registerAspect(&repetitionMode); repetitionMode.setSettingsKey("RepetitionMode"); - repetitionMode.setLabelText(tr("Repetition mode")); + repetitionMode.setLabelText(Tr::tr("Repetition mode")); repetitionMode.setDisplayStyle(Utils::SelectionAspect::DisplayStyle::ComboBox); - repetitionMode.addOption({tr("Until Fail"), {}, 0}); - repetitionMode.addOption({tr("Until Pass"), {}, 1}); - repetitionMode.addOption({tr("After Timeout"), {}, 2}); + repetitionMode.addOption({Tr::tr("Until Fail"), {}, 0}); + repetitionMode.addOption({Tr::tr("Until Pass"), {}, 1}); + repetitionMode.addOption({Tr::tr("After Timeout"), {}, 2}); registerAspect(&repetitionCount); repetitionCount.setSettingsKey("RepetitionCount"); repetitionCount.setDefaultValue(1); - repetitionCount.setLabelText(tr("Count")); - repetitionCount.setToolTip(tr("Number of re-runs for the test.")); + repetitionCount.setLabelText(Tr::tr("Count")); + repetitionCount.setToolTip(Tr::tr("Number of re-runs for the test.")); repetitionCount.setRange(1, 10000); registerAspect(&repeat); @@ -70,31 +71,31 @@ CTestSettings::CTestSettings() registerAspect(&scheduleRandom); scheduleRandom.setSettingsKey("ScheduleRandom"); - scheduleRandom.setLabelText(tr("Schedule random")); + scheduleRandom.setLabelText(Tr::tr("Schedule random")); registerAspect(&stopOnFailure); stopOnFailure.setSettingsKey("StopOnFail"); - stopOnFailure.setLabelText(tr("Stop on failure")); + stopOnFailure.setLabelText(Tr::tr("Stop on failure")); registerAspect(¶llel); parallel.setSettingsKey("Parallel"); - parallel.setToolTip(tr("Run tests in parallel mode using given number of jobs.")); + parallel.setToolTip(Tr::tr("Run tests in parallel mode using given number of jobs.")); registerAspect(&jobs); jobs.setSettingsKey("Jobs"); - jobs.setLabelText(tr("Jobs")); + jobs.setLabelText(Tr::tr("Jobs")); jobs.setDefaultValue(1); jobs.setRange(1, 128); registerAspect(&testLoad); testLoad.setSettingsKey("TestLoad"); - testLoad.setLabelText(tr("Test load")); - testLoad.setToolTip(tr("Try not to start tests when they may cause CPU load to pass a " + testLoad.setLabelText(Tr::tr("Test load")); + testLoad.setToolTip(Tr::tr("Try not to start tests when they may cause CPU load to pass a " "threshold.")); registerAspect(&threshold); threshold.setSettingsKey("Threshold"); - threshold.setLabelText(tr("Threshold")); + threshold.setLabelText(Tr::tr("Threshold")); threshold.setDefaultValue(1); threshold.setRange(1, 128); threshold.setEnabler(&testLoad); @@ -140,7 +141,7 @@ CTestSettingsPage::CTestSettingsPage(CTestSettings *settings, Utils::Id settings { setId(settingsId); setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); - setDisplayName(tr("CTest")); + setDisplayName(Tr::tr("CTest")); setSettings(settings); @@ -154,11 +155,11 @@ CTestSettingsPage::CTestSettingsPage(CTestSettings *settings, Utils::Id settings Row {s.stopOnFailure}, br, Row {s.outputMode}, br, Group { - title(tr("Repeat tests"), &s.repeat), + title(Tr::tr("Repeat tests"), &s.repeat), Row {s.repetitionMode, s.repetitionCount}, }, br, Group { - title(tr("Run in parallel"), &s.parallel), + title(Tr::tr("Run in parallel"), &s.parallel), Column { Row {s.jobs}, br, Row {s.testLoad, s.threshold} diff --git a/src/plugins/autotest/ctest/ctestsettings.h b/src/plugins/autotest/ctest/ctestsettings.h index 5683987e9d..50edb75180 100644 --- a/src/plugins/autotest/ctest/ctestsettings.h +++ b/src/plugins/autotest/ctest/ctestsettings.h @@ -34,7 +34,6 @@ namespace Internal { class CTestSettings : public Utils::AspectContainer { - Q_DECLARE_TR_FUNCTIONS(Autotest::Internal::CTestSettings) public: CTestSettings(); @@ -56,7 +55,6 @@ public: class CTestSettingsPage final : public Core::IOptionsPage { - Q_DECLARE_TR_FUNCTIONS(Autotest::Internal::CTestSettingsPage) public: CTestSettingsPage(CTestSettings *settings, Utils::Id settingsId); }; diff --git a/src/plugins/autotest/ctest/ctesttool.cpp b/src/plugins/autotest/ctest/ctesttool.cpp index 0f9bd8eeca..4bd3fcea38 100644 --- a/src/plugins/autotest/ctest/ctesttool.cpp +++ b/src/plugins/autotest/ctest/ctesttool.cpp @@ -25,6 +25,7 @@ #include "ctesttool.h" #include "ctesttreeitem.h" +#include "../autotesttr.h" #include <cmakeprojectmanager/cmakeprojectconstants.h> @@ -52,7 +53,7 @@ const char *CTestTool::name() const QString CTestTool::displayName() const { - return QCoreApplication::translate("CTestTool", "CTest"); + return Tr::tr("CTest"); } ITestTreeItem *CTestTool::createRootNode() diff --git a/src/plugins/autotest/gtest/gtestconfiguration.cpp b/src/plugins/autotest/gtest/gtestconfiguration.cpp index 025040f54c..98eea2e6c9 100644 --- a/src/plugins/autotest/gtest/gtestconfiguration.cpp +++ b/src/plugins/autotest/gtest/gtestconfiguration.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "gtestconfiguration.h" -#include "gtestconstants.h" + #include "gtestoutputreader.h" #include "gtestsettings.h" #include "../autotestplugin.h" diff --git a/src/plugins/autotest/gtest/gtestconstants.h b/src/plugins/autotest/gtest/gtestconstants.h index 2b1a878a1f..b883060f10 100644 --- a/src/plugins/autotest/gtest/gtestconstants.h +++ b/src/plugins/autotest/gtest/gtestconstants.h @@ -32,7 +32,7 @@ namespace GTest { namespace Constants { const char FRAMEWORK_NAME[] = "GTest"; -const char FRAMEWORK_SETTINGS_CATEGORY[] = QT_TRANSLATE_NOOP("GTestFramework", "Google Test"); +const char FRAMEWORK_SETTINGS_CATEGORY[] = QT_TRANSLATE_NOOP("Autotest", "Google Test"); const unsigned FRAMEWORK_PRIORITY = 10; const char DEFAULT_FILTER[] = "*.*"; diff --git a/src/plugins/autotest/gtest/gtestframework.cpp b/src/plugins/autotest/gtest/gtestframework.cpp index ec84108d68..0e597061ab 100644 --- a/src/plugins/autotest/gtest/gtestframework.cpp +++ b/src/plugins/autotest/gtest/gtestframework.cpp @@ -24,9 +24,10 @@ ****************************************************************************/ #include "gtestframework.h" + +#include "../autotesttr.h" #include "gtesttreeitem.h" #include "gtestparser.h" -#include "../testframeworkmanager.h" namespace Autotest { namespace Internal { @@ -59,8 +60,7 @@ const char *GTestFramework::name() const QString GTestFramework:: displayName() const { - return QCoreApplication::translate("GTestFramework", - GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY); + return Tr::tr(GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY); } unsigned GTestFramework::priority() const @@ -75,9 +75,8 @@ QString GTestFramework::currentGTestFilter() QString GTestFramework::groupingToolTip() const { - return QCoreApplication::translate("GTestFramework", - "Enable or disable grouping of test cases by folder or " - "GTest filter.\nSee also Google Test settings."); + return Tr::tr("Enable or disable grouping of test cases by folder or " + "GTest filter.\nSee also Google Test settings."); } GTest::Constants::GroupMode GTestFramework::groupMode() diff --git a/src/plugins/autotest/gtest/gtestoutputreader.cpp b/src/plugins/autotest/gtest/gtestoutputreader.cpp index 4935b6599b..3479982ec1 100644 --- a/src/plugins/autotest/gtest/gtestoutputreader.cpp +++ b/src/plugins/autotest/gtest/gtestoutputreader.cpp @@ -24,14 +24,14 @@ ****************************************************************************/ #include "gtestoutputreader.h" + #include "gtestresult.h" -#include "../testtreemodel.h" #include "../testtreeitem.h" +#include "../autotesttr.h" + #include <utils/hostosinfo.h> #include <utils/qtcprocess.h> -#include <QDir> -#include <QFileInfo> #include <QRegularExpression> namespace Autotest { @@ -48,7 +48,7 @@ GTestOutputReader::GTestOutputReader(const QFutureInterface<TestResultPtr> &futu connect(m_testApplication, &Utils::QtcProcess::done, this, [this] { const int exitCode = m_testApplication->exitCode(); if (exitCode == 1 && !m_description.isEmpty()) { - createAndReportResult(tr("Running tests failed.\n %1\nExecutable: %2") + createAndReportResult(Tr::tr("Running tests failed.\n %1\nExecutable: %2") .arg(m_description).arg(id()), ResultType::MessageFatal); } // on Windows abort() will result in normal termination, but exit code will be set to 3 @@ -91,7 +91,7 @@ void GTestOutputReader::processOutputLine(const QByteArray &outputLine) } else if (line.startsWith(QStringLiteral("Note:"))) { m_description = line; if (m_iteration > 1) - m_description.append(' ' + tr("(iteration %1)").arg(m_iteration)); + m_description.append(' ' + Tr::tr("(iteration %1)").arg(m_iteration)); TestResultPtr testResult = TestResultPtr(new GTestResult(id(), m_projectFile, QString())); testResult->setResult(ResultType::MessageInternal); testResult->setDescription(m_description); @@ -107,7 +107,7 @@ void GTestOutputReader::processOutputLine(const QByteArray &outputLine) if (ExactMatch match = testEnds.match(line)) { TestResultPtr testResult = createDefaultResult(); testResult->setResult(ResultType::TestEnd); - testResult->setDescription(tr("Test execution took %1").arg(match.captured(2))); + testResult->setDescription(Tr::tr("Test execution took %1").arg(match.captured(2))); reportResult(testResult); m_currentTestSuite.clear(); m_currentTestCase.clear(); @@ -116,10 +116,10 @@ void GTestOutputReader::processOutputLine(const QByteArray &outputLine) TestResultPtr testResult = createDefaultResult(); testResult->setResult(ResultType::TestStart); if (m_iteration > 1) { - testResult->setDescription(tr("Repeating test suite %1 (iteration %2)") + testResult->setDescription(Tr::tr("Repeating test suite %1 (iteration %2)") .arg(m_currentTestSuite).arg(m_iteration)); } else { - testResult->setDescription(tr("Executing test suite %1").arg(m_currentTestSuite)); + testResult->setDescription(Tr::tr("Executing test suite %1").arg(m_currentTestSuite)); } reportResult(testResult); } else if (ExactMatch match = newTestSetStarts.match(line)) { @@ -128,7 +128,7 @@ void GTestOutputReader::processOutputLine(const QByteArray &outputLine) TestResultPtr testResult = TestResultPtr(new GTestResult(QString(), m_projectFile, QString())); testResult->setResult(ResultType::MessageCurrentTest); - testResult->setDescription(tr("Entering test case %1").arg(m_currentTestCase)); + testResult->setDescription(Tr::tr("Entering test case %1").arg(m_currentTestCase)); reportResult(testResult); m_description.clear(); } else if (ExactMatch match = testSetSuccess.match(line)) { @@ -140,7 +140,7 @@ void GTestOutputReader::processOutputLine(const QByteArray &outputLine) m_description.clear(); testResult = createDefaultResult(); testResult->setResult(ResultType::MessageInternal); - testResult->setDescription(tr("Execution took %1.").arg(match.captured(2))); + testResult->setDescription(Tr::tr("Execution took %1.").arg(match.captured(2))); reportResult(testResult); m_futureInterface.setProgressValue(m_futureInterface.progressValue() + 1); } else if (ExactMatch match = testSetFail.match(line)) { @@ -151,7 +151,7 @@ void GTestOutputReader::processOutputLine(const QByteArray &outputLine) handleDescriptionAndReportResult(testResult); testResult = createDefaultResult(); testResult->setResult(ResultType::MessageInternal); - testResult->setDescription(tr("Execution took %1.").arg(match.captured(2))); + testResult->setDescription(Tr::tr("Execution took %1.").arg(match.captured(2))); reportResult(testResult); m_futureInterface.setProgressValue(m_futureInterface.progressValue() + 1); } else if (ExactMatch match = testSetSkipped.match(line)) { @@ -165,7 +165,7 @@ void GTestOutputReader::processOutputLine(const QByteArray &outputLine) handleDescriptionAndReportResult(testResult); testResult = createDefaultResult(); testResult->setResult(ResultType::MessageInternal); - testResult->setDescription(tr("Execution took %1.").arg(match.captured(2))); + testResult->setDescription(Tr::tr("Execution took %1.").arg(match.captured(2))); reportResult(testResult); } else if (ExactMatch match = logging.match(line)) { const QString severity = match.captured(1).trimmed(); diff --git a/src/plugins/autotest/gtest/gtestoutputreader.h b/src/plugins/autotest/gtest/gtestoutputreader.h index f6d499dbed..962f204835 100644 --- a/src/plugins/autotest/gtest/gtestoutputreader.h +++ b/src/plugins/autotest/gtest/gtestoutputreader.h @@ -27,15 +27,11 @@ #include "../testoutputreader.h" -#include <QCoreApplication> - namespace Autotest { namespace Internal { class GTestOutputReader : public TestOutputReader { - Q_DECLARE_TR_FUNCTIONS(Autotest::Internal::GTestOutputReader) - public: GTestOutputReader(const QFutureInterface<TestResultPtr> &futureInterface, Utils::QtcProcess *testApplication, const Utils::FilePath &buildDirectory, diff --git a/src/plugins/autotest/gtest/gtestparser.cpp b/src/plugins/autotest/gtest/gtestparser.cpp index 9e2e6b2993..3731ad5a7a 100644 --- a/src/plugins/autotest/gtest/gtestparser.cpp +++ b/src/plugins/autotest/gtest/gtestparser.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "gtestparser.h" -#include "gtestframework.h" + #include "gtesttreeitem.h" #include "gtestvisitors.h" #include "gtest_utils.h" diff --git a/src/plugins/autotest/gtest/gtestsettings.cpp b/src/plugins/autotest/gtest/gtestsettings.cpp index 14d72f826b..45cdf54212 100644 --- a/src/plugins/autotest/gtest/gtestsettings.cpp +++ b/src/plugins/autotest/gtest/gtestsettings.cpp @@ -28,7 +28,7 @@ #include "gtest_utils.h" #include "gtestconstants.h" #include "../autotestconstants.h" -#include "../testframeworkmanager.h" +#include "../autotesttr.h" #include "../testtreemodel.h" #include <utils/layoutbuilder.h> @@ -47,42 +47,42 @@ GTestSettings::GTestSettings() iterations.setSettingsKey("Iterations"); iterations.setDefaultValue(1); iterations.setEnabled(false); - iterations.setLabelText(tr("Iterations:")); + iterations.setLabelText(Tr::tr("Iterations:")); iterations.setEnabler(&repeat); registerAspect(&seed); seed.setSettingsKey("Seed"); seed.setSpecialValueText(QString()); seed.setEnabled(false); - seed.setLabelText(tr("Seed:")); - seed.setToolTip(tr("A seed of 0 generates a seed based on the current timestamp.")); + seed.setLabelText(Tr::tr("Seed:")); + seed.setToolTip(Tr::tr("A seed of 0 generates a seed based on the current timestamp.")); seed.setEnabler(&shuffle); registerAspect(&runDisabled); runDisabled.setSettingsKey("RunDisabled"); - runDisabled.setLabelText(tr("Run disabled tests")); - runDisabled.setToolTip(tr("Executes disabled tests when performing a test run.")); + runDisabled.setLabelText(Tr::tr("Run disabled tests")); + runDisabled.setToolTip(Tr::tr("Executes disabled tests when performing a test run.")); registerAspect(&shuffle); shuffle.setSettingsKey("Shuffle"); - shuffle.setLabelText(tr("Shuffle tests")); - shuffle.setToolTip(tr("Shuffles tests automatically on every iteration by the given seed.")); + shuffle.setLabelText(Tr::tr("Shuffle tests")); + shuffle.setToolTip(Tr::tr("Shuffles tests automatically on every iteration by the given seed.")); registerAspect(&repeat); repeat.setSettingsKey("Repeat"); - repeat.setLabelText(tr("Repeat tests")); - repeat.setToolTip(tr("Repeats a test run (you might be required to increase the timeout to avoid canceling the tests).")); + repeat.setLabelText(Tr::tr("Repeat tests")); + repeat.setToolTip(Tr::tr("Repeats a test run (you might be required to increase the timeout to avoid canceling the tests).")); registerAspect(&throwOnFailure); throwOnFailure.setSettingsKey("ThrowOnFailure"); - throwOnFailure.setLabelText(tr("Throw on failure")); - throwOnFailure.setToolTip(tr("Turns assertion failures into C++ exceptions.")); + throwOnFailure.setLabelText(Tr::tr("Throw on failure")); + throwOnFailure.setToolTip(Tr::tr("Turns assertion failures into C++ exceptions.")); registerAspect(&breakOnFailure); breakOnFailure.setSettingsKey("BreakOnFailure"); breakOnFailure.setDefaultValue(true); - breakOnFailure.setLabelText(tr("Break on failure while debugging")); - breakOnFailure.setToolTip(tr("Turns failures into debugger breakpoints.")); + breakOnFailure.setLabelText(Tr::tr("Break on failure while debugging")); + breakOnFailure.setToolTip(Tr::tr("Turns failures into debugger breakpoints.")); registerAspect(&groupMode); groupMode.setSettingsKey("GroupMode"); @@ -96,11 +96,11 @@ GTestSettings::GTestSettings() groupMode.setToSettingsTransformation([this](const QVariant &value) { return groupMode.itemValueForIndex(value.toInt()); }); - groupMode.addOption({tr("Directory"), {}, GTest::Constants::Directory}); - groupMode.addOption({tr("GTest Filter"), {}, GTest::Constants::GTestFilter}); + groupMode.addOption({Tr::tr("Directory"), {}, GTest::Constants::Directory}); + groupMode.addOption({Tr::tr("GTest Filter"), {}, GTest::Constants::GTestFilter}); groupMode.setDefaultValue(GTest::Constants::Directory); - groupMode.setLabelText(tr("Group mode:")); - groupMode.setToolTip(tr("Select on what grouping the tests should be based.")); + groupMode.setLabelText(Tr::tr("Group mode:")); + groupMode.setToolTip(Tr::tr("Select on what grouping the tests should be based.")); registerAspect(>estFilter); gtestFilter.setSettingsKey("GTestFilter"); @@ -114,8 +114,8 @@ GTestSettings::GTestSettings() return GTest::Constants::DEFAULT_FILTER; }); gtestFilter.setEnabled(false); - gtestFilter.setLabelText(tr("Active filter:")); - gtestFilter.setToolTip(tr("Set the GTest filter to be used for grouping.\n" + gtestFilter.setLabelText(Tr::tr("Active filter:")); + gtestFilter.setToolTip(Tr::tr("Set the GTest filter to be used for grouping.\n" "See Google Test documentation for further information on GTest filters.")); gtestFilter.setValidationFunction([](FancyLineEdit *edit, QString * /*error*/) { @@ -132,9 +132,9 @@ GTestSettingsPage::GTestSettingsPage(GTestSettings *settings, Utils::Id settings { setId(settingsId); setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); - setDisplayName(QCoreApplication::translate("GTestFramework", - GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); + setDisplayName(Tr::tr(GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); setSettings(settings); + QObject::connect(settings, &AspectContainer::applied, this, [] { Id id = Id(Constants::FRAMEWORK_PREFIX).withSuffix(GTest::Constants::FRAMEWORK_NAME); TestTreeModel::instance()->rebuild({id}); diff --git a/src/plugins/autotest/gtest/gtestsettings.h b/src/plugins/autotest/gtest/gtestsettings.h index ea9a7621f3..cc8a38ce75 100644 --- a/src/plugins/autotest/gtest/gtestsettings.h +++ b/src/plugins/autotest/gtest/gtestsettings.h @@ -25,8 +25,6 @@ #pragma once -#include "gtestconstants.h" - #include <coreplugin/dialogs/ioptionspage.h> #include <utils/aspects.h> @@ -36,8 +34,6 @@ namespace Internal { class GTestSettings : public Utils::AspectContainer { - Q_DECLARE_TR_FUNCTIONS(Autotest::Internal::GTestSettings) - public: GTestSettings(); @@ -54,8 +50,6 @@ public: class GTestSettingsPage final : public Core::IOptionsPage { - Q_DECLARE_TR_FUNCTIONS(Autotest::Internal::GTestSettings) - public: GTestSettingsPage(GTestSettings *settings, Utils::Id settingsId); }; diff --git a/src/plugins/autotest/gtest/gtesttreeitem.cpp b/src/plugins/autotest/gtest/gtesttreeitem.cpp index 507792a2be..6e72e86b25 100644 --- a/src/plugins/autotest/gtest/gtesttreeitem.cpp +++ b/src/plugins/autotest/gtest/gtesttreeitem.cpp @@ -24,11 +24,12 @@ ****************************************************************************/ #include "gtesttreeitem.h" + #include "gtestconfiguration.h" #include "gtestconstants.h" #include "gtestframework.h" #include "gtestparser.h" -#include "../testframeworkmanager.h" +#include "../autotesttr.h" #include <cppeditor/cppmodelmanager.h> #include <projectexplorer/session.h> @@ -46,12 +47,12 @@ namespace Internal { static QString matchingString() { - return QCoreApplication::translate("GTestTreeItem", "<matching>"); + return Tr::tr("<matching>"); } static QString notMatchingString() { - return QCoreApplication::translate("GTestTreeItem", "<not matching>"); + return Tr::tr("<not matching>"); } static QString gtestFilter(GTestTreeItem::TestStates states) @@ -140,8 +141,7 @@ QVariant GTestTreeItem::data(int column, int role) const if (type() == GroupNode && GTestFramework::groupMode() == GTest::Constants::GTestFilter) { const auto tpl = QString("<p>%1</p><p>%2</p>").arg(filePath().toString()); - return tpl.arg(QCoreApplication::translate( - "GTestTreeItem", "Change GTest filter in use inside the settings.")); + return tpl.arg(Tr::tr("Change GTest filter in use inside the settings.")); } break; case Qt::CheckStateRole: @@ -507,8 +507,8 @@ TestTreeItem *GTestTreeItem::findChildByNameStateAndFile(const QString &name, QString GTestTreeItem::nameSuffix() const { - static QString markups[] = {QCoreApplication::translate("GTestTreeItem", "parameterized"), - QCoreApplication::translate("GTestTreeItem", "typed")}; + static QString markups[] = {Tr::tr("parameterized"), Tr::tr("typed")}; + QString suffix; if (m_state & Parameterized) suffix = QString(" [") + markups[0]; diff --git a/src/plugins/autotest/projectsettingswidget.cpp b/src/plugins/autotest/projectsettingswidget.cpp index 18850734c1..b08be813fd 100644 --- a/src/plugins/autotest/projectsettingswidget.cpp +++ b/src/plugins/autotest/projectsettingswidget.cpp @@ -27,7 +27,7 @@ #include "autotestconstants.h" #include "autotestplugin.h" -#include "testframeworkmanager.h" +#include "autotesttr.h" #include "testprojectsettings.h" #include "testtreemodel.h" @@ -67,14 +67,14 @@ ProjectTestSettingsWidget::ProjectTestSettingsWidget(ProjectExplorer::Project *p m_activeFrameworks = new QTreeWidget; m_activeFrameworks->setHeaderHidden(true); m_activeFrameworks->setRootIsDecorated(false); - groupBoxLayout->addWidget(new QLabel(tr("Active frameworks:"))); + groupBoxLayout->addWidget(new QLabel(Tr::tr("Active frameworks:"))); groupBoxLayout->addWidget(m_activeFrameworks); auto horizontalLayout = new QHBoxLayout; - horizontalLayout->addWidget(new QLabel(tr("Automatically run tests after build"))); + horizontalLayout->addWidget(new QLabel(Tr::tr("Automatically run tests after build"))); m_runAfterBuild = new QComboBox; - m_runAfterBuild->addItem(tr("None")); - m_runAfterBuild->addItem(tr("All")); - m_runAfterBuild->addItem(tr("Selected")); + m_runAfterBuild->addItem(Tr::tr("None")); + m_runAfterBuild->addItem(Tr::tr("All")); + m_runAfterBuild->addItem(Tr::tr("Selected")); m_runAfterBuild->setCurrentIndex(int(m_projectSettings->runAfterBuild())); horizontalLayout->addWidget(m_runAfterBuild); horizontalLayout->addItem(createSpacer(QSizePolicy::Expanding, QSizePolicy::Minimum)); diff --git a/src/plugins/autotest/qtest/qttestconstants.h b/src/plugins/autotest/qtest/qttestconstants.h index 7bd602a505..35be366144 100644 --- a/src/plugins/autotest/qtest/qttestconstants.h +++ b/src/plugins/autotest/qtest/qttestconstants.h @@ -32,7 +32,7 @@ namespace QtTest { namespace Constants { const char FRAMEWORK_NAME[] = "QtTest"; -const char FRAMEWORK_SETTINGS_CATEGORY[] = QT_TRANSLATE_NOOP("QtTestFramework", "Qt Test"); +const char FRAMEWORK_SETTINGS_CATEGORY[] = QT_TRANSLATE_NOOP("Autotest", "Qt Test"); const unsigned FRAMEWORK_PRIORITY = 1; } // namespace Constants diff --git a/src/plugins/autotest/qtest/qttestframework.cpp b/src/plugins/autotest/qtest/qttestframework.cpp index 15686c57c9..5b07556d55 100644 --- a/src/plugins/autotest/qtest/qttestframework.cpp +++ b/src/plugins/autotest/qtest/qttestframework.cpp @@ -24,9 +24,11 @@ ****************************************************************************/ #include "qttestframework.h" + #include "qttestconstants.h" #include "qttestparser.h" #include "qttesttreeitem.h" +#include "../autotesttr.h" namespace Autotest { namespace Internal { @@ -51,8 +53,7 @@ const char *QtTestFramework::name() const QString QtTestFramework::displayName() const { - return QCoreApplication::translate("QtTestFramework", - QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY); + return Tr::tr(QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY); } unsigned QtTestFramework::priority() const diff --git a/src/plugins/autotest/qtest/qttestoutputreader.cpp b/src/plugins/autotest/qtest/qttestoutputreader.cpp index fc762bbe0a..d1bf0aa28c 100644 --- a/src/plugins/autotest/qtest/qttestoutputreader.cpp +++ b/src/plugins/autotest/qtest/qttestoutputreader.cpp @@ -24,7 +24,9 @@ ****************************************************************************/ #include "qttestoutputreader.h" + #include "qttestresult.h" +#include "../autotesttr.h" #include "../testtreeitem.h" #include <qtsupport/qtoutputformatter.h> @@ -118,7 +120,7 @@ static QString constructBenchmarkInformation(const QString &metric, double value metricsText = "instruction reads"; else if (metric == "CPUCycles") // -perf metricsText = "CPU cycles"; - return QtTestOutputReader::tr("%1 %2 per iteration (total: %3, iterations: %4)") + return Tr::tr("%1 %2 per iteration (total: %3, iterations: %4)") .arg(formatResult(value)) .arg(metricsText) .arg(formatResult(value * double(iterations))) @@ -162,17 +164,17 @@ TestResultPtr QtTestOutputReader::createDefaultResult() const static QString trQtVersion(const QString &version) { - return QtTestOutputReader::tr("Qt version: %1").arg(version); + return Tr::tr("Qt version: %1").arg(version); } static QString trQtBuild(const QString &build) { - return QtTestOutputReader::tr("Qt build: %1").arg(build); + return Tr::tr("Qt build: %1").arg(build); } static QString trQtestVersion(const QString &test) { - return QtTestOutputReader::tr("QTest version: %1").arg(test); + return Tr::tr("QTest version: %1").arg(test); } void QtTestOutputReader::processXMLOutput(const QByteArray &outputLine) @@ -317,7 +319,7 @@ void QtTestOutputReader::processXMLOutput(const QByteArray &outputLine) // premature end happens e.g. if not all data has been added to the reader yet if (m_xmlReader.error() != QXmlStreamReader::NoError && m_xmlReader.error() != QXmlStreamReader::PrematureEndOfDocumentError) { - createAndReportResult(tr("XML parsing failed.") + createAndReportResult(Tr::tr("XML parsing failed.") + QString(" (%1) ").arg(m_xmlReader.error()) + m_xmlReader.errorString(), ResultType::MessageFatal); } @@ -499,7 +501,7 @@ void QtTestOutputReader::sendMessageCurrentTest() { QtTestResult *testResult = new QtTestResult(QString(), m_projectFile, m_testType, QString()); testResult->setResult(ResultType::MessageCurrentTest); - testResult->setDescription(tr("Entering test function %1::%2").arg(m_className, m_testCase)); + testResult->setDescription(Tr::tr("Entering test function %1::%2").arg(m_className, m_testCase)); reportResult(TestResultPtr(testResult)); } @@ -507,8 +509,8 @@ void QtTestOutputReader::sendStartMessage(bool isFunction) { TestResultPtr testResult = createDefaultResult(); testResult->setResult(ResultType::TestStart); - testResult->setDescription(isFunction ? tr("Executing test function %1").arg(m_testCase) - : tr("Executing test case %1").arg(m_className)); + testResult->setDescription(isFunction ? Tr::tr("Executing test function %1").arg(m_testCase) + : Tr::tr("Executing test case %1").arg(m_className)); const ITestTreeItem *testItem = testResult->findTestTreeItem(); if (testItem && testItem->line()) { testResult->setFileName(testItem->filePath()); @@ -522,11 +524,11 @@ void QtTestOutputReader::sendFinishMessage(bool isFunction) TestResultPtr testResult = createDefaultResult(); testResult->setResult(ResultType::TestEnd); if (!m_duration.isEmpty()) { - testResult->setDescription(isFunction ? tr("Execution took %1 ms.").arg(m_duration) - : tr("Test execution took %1 ms.").arg(m_duration)); + testResult->setDescription(isFunction ? Tr::tr("Execution took %1 ms.").arg(m_duration) + : Tr::tr("Test execution took %1 ms.").arg(m_duration)); } else { - testResult->setDescription(isFunction ? tr("Test function finished.") - : tr("Test finished.")); + testResult->setDescription(isFunction ? Tr::tr("Test function finished.") + : Tr::tr("Test finished.")); } reportResult(testResult); } diff --git a/src/plugins/autotest/qtest/qttestoutputreader.h b/src/plugins/autotest/qtest/qttestoutputreader.h index 6ceabd508b..8749eb8b53 100644 --- a/src/plugins/autotest/qtest/qttestoutputreader.h +++ b/src/plugins/autotest/qtest/qttestoutputreader.h @@ -28,7 +28,6 @@ #include "qttestconstants.h" #include "../testoutputreader.h" -#include <QCoreApplication> #include <QXmlStreamReader> namespace Autotest { @@ -38,8 +37,6 @@ class QtTestResult; class QtTestOutputReader : public TestOutputReader { - Q_DECLARE_TR_FUNCTIONS(Autotest::Internal::QtTestOutputReader) - public: enum OutputMode { diff --git a/src/plugins/autotest/qtest/qttestparser.cpp b/src/plugins/autotest/qtest/qttestparser.cpp index 69246a5dcd..10bb965198 100644 --- a/src/plugins/autotest/qtest/qttestparser.cpp +++ b/src/plugins/autotest/qtest/qttestparser.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "qttestparser.h" -#include "qttestframework.h" + #include "qttestvisitors.h" #include <cppeditor/cppmodelmanager.h> diff --git a/src/plugins/autotest/qtest/qttestsettings.cpp b/src/plugins/autotest/qtest/qttestsettings.cpp index 09dbaa37a0..4af869b708 100644 --- a/src/plugins/autotest/qtest/qttestsettings.cpp +++ b/src/plugins/autotest/qtest/qttestsettings.cpp @@ -26,6 +26,7 @@ #include "qttestsettings.h" #include "../autotestconstants.h" +#include "../autotesttr.h" #include "qttestconstants.h" #include <utils/hostosinfo.h> @@ -44,54 +45,54 @@ QtTestSettings::QtTestSettings() registerAspect(&metrics); metrics.setSettingsKey("Metrics"); metrics.setDefaultValue(Walltime); - metrics.addOption(tr("Walltime"), tr("Uses walltime metrics for executing benchmarks (default).")); - metrics.addOption(tr("Tick counter"), tr("Uses tick counter when executing benchmarks.")); - metrics.addOption(tr("Event counter"), tr("Uses event counter when executing benchmarks.")); + metrics.addOption(Tr::tr("Walltime"), Tr::tr("Uses walltime metrics for executing benchmarks (default).")); + metrics.addOption(Tr::tr("Tick counter"), Tr::tr("Uses tick counter when executing benchmarks.")); + metrics.addOption(Tr::tr("Event counter"), Tr::tr("Uses event counter when executing benchmarks.")); metrics.addOption({ - tr("Callgrind"), - tr("Uses Valgrind Callgrind when executing benchmarks (it must be installed)."), + Tr::tr("Callgrind"), + Tr::tr("Uses Valgrind Callgrind when executing benchmarks (it must be installed)."), HostOsInfo::isAnyUnixHost() // valgrind available on UNIX }); metrics.addOption({ - tr("Perf"), - tr("Uses Perf when executing benchmarks (it must be installed)."), + Tr::tr("Perf"), + Tr::tr("Uses Perf when executing benchmarks (it must be installed)."), HostOsInfo::isLinuxHost() // according to docs perf Linux only }); registerAspect(&noCrashHandler); noCrashHandler.setSettingsKey("NoCrashhandlerOnDebug"); noCrashHandler.setDefaultValue(true); - noCrashHandler.setLabelText(tr("Disable crash handler while debugging")); - noCrashHandler.setToolTip(tr("Enables interrupting tests on assertions.")); + noCrashHandler.setLabelText(Tr::tr("Disable crash handler while debugging")); + noCrashHandler.setToolTip(Tr::tr("Enables interrupting tests on assertions.")); registerAspect(&useXMLOutput); useXMLOutput.setSettingsKey("UseXMLOutput"); useXMLOutput.setDefaultValue(true); - useXMLOutput.setLabelText(tr("Use XML output")); - useXMLOutput.setToolTip(tr("XML output is recommended, because it avoids parsing issues, " + useXMLOutput.setLabelText(Tr::tr("Use XML output")); + useXMLOutput.setToolTip(Tr::tr("XML output is recommended, because it avoids parsing issues, " "while plain text is more human readable.\n\n" "Warning: Plain text misses some information, such as duration.")); registerAspect(&verboseBench); verboseBench.setSettingsKey("VerboseBench"); - verboseBench.setLabelText(tr("Verbose benchmarks")); + verboseBench.setLabelText(Tr::tr("Verbose benchmarks")); registerAspect(&logSignalsSlots); logSignalsSlots.setSettingsKey("LogSignalsSlots"); - logSignalsSlots.setLabelText(tr("Log signals and slots")); - logSignalsSlots.setToolTip(tr("Log every signal emission and resulting slot invocations.")); + logSignalsSlots.setLabelText(Tr::tr("Log signals and slots")); + logSignalsSlots.setToolTip(Tr::tr("Log every signal emission and resulting slot invocations.")); registerAspect(&limitWarnings); limitWarnings.setSettingsKey("LimitWarnings"); - limitWarnings.setLabelText(tr("Limit warnings")); - limitWarnings.setToolTip(tr("Set the maximum number of warnings. 0 means that the number " + limitWarnings.setLabelText(Tr::tr("Limit warnings")); + limitWarnings.setToolTip(Tr::tr("Set the maximum number of warnings. 0 means that the number " "is not limited.")); registerAspect(&maxWarnings); maxWarnings.setSettingsKey("MaxWarnings"); maxWarnings.setRange(0, 10000); maxWarnings.setDefaultValue(2000); - maxWarnings.setSpecialValueText(tr("Unlimited")); + maxWarnings.setSpecialValueText(Tr::tr("Unlimited")); maxWarnings.setEnabler(&limitWarnings); } @@ -116,8 +117,7 @@ QtTestSettingsPage::QtTestSettingsPage(QtTestSettings *settings, Id settingsId) { setId(settingsId); setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); - setDisplayName(QCoreApplication::translate("QtTestFramework", - QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); + setDisplayName(Tr::tr(QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY)); setSettings(settings); setLayouter([settings](QWidget *widget) { @@ -133,7 +133,7 @@ QtTestSettingsPage::QtTestSettingsPage(QtTestSettings *settings, Id settingsId) s.limitWarnings, s.maxWarnings }, Group { - title(QtTestSettings::tr("Benchmark Metrics")), + title(Tr::tr("Benchmark Metrics")), Column { s.metrics } }, }; diff --git a/src/plugins/autotest/qtest/qttestsettings.h b/src/plugins/autotest/qtest/qttestsettings.h index 682f66c5d7..c5e193a9a7 100644 --- a/src/plugins/autotest/qtest/qttestsettings.h +++ b/src/plugins/autotest/qtest/qttestsettings.h @@ -43,7 +43,6 @@ enum MetricsType class QtTestSettings : public Utils::AspectContainer { - Q_DECLARE_TR_FUNCTIONS(Autotest::Internal::QtTestSettings) public: QtTestSettings(); diff --git a/src/plugins/autotest/qtest/qttesttreeitem.cpp b/src/plugins/autotest/qtest/qttesttreeitem.cpp index 6552a04997..659953475c 100644 --- a/src/plugins/autotest/qtest/qttesttreeitem.cpp +++ b/src/plugins/autotest/qtest/qttesttreeitem.cpp @@ -24,9 +24,11 @@ ****************************************************************************/ #include "qttesttreeitem.h" + #include "qttestconfiguration.h" #include "qttestparser.h" -#include "qttestframework.h" +#include "../autotesttr.h" +#include "../itestframework.h" #include <cppeditor/cppmodelmanager.h> #include <projectexplorer/session.h> @@ -62,10 +64,9 @@ QVariant QtTestTreeItem::data(int column, int role) const case Qt::ToolTipRole: { QString toolTip = TestTreeItem::data(column, role).toString(); if (m_multiTest && type() == TestCase) { - toolTip.append(QCoreApplication::translate("QtTestTreeItem", - "<p>Multiple testcases inside a single executable are not officially " - "supported. Depending on the implementation they might get executed " - "or not, but never will be explicitly selectable.</p>")); + toolTip.append(Tr::tr("<p>Multiple testcases inside a single executable are not officially " + "supported. Depending on the implementation they might get executed " + "or not, but never will be explicitly selectable.</p>")); } return toolTip; break; @@ -438,8 +439,9 @@ TestTreeItem *QtTestTreeItem::findChildByNameAndInheritanceAndMultiTest(const QS QString QtTestTreeItem::nameSuffix() const { - static const QString inherited{QCoreApplication::translate("QtTestTreeItem", "inherited")}; - static const QString multi{QCoreApplication::translate("QtTestTreeItem", "multiple testcases")}; + static const QString inherited = Tr::tr("inherited"); + static const QString multi = Tr::tr("multiple testcases"); + QString suffix; if (m_inherited) suffix.append(inherited); diff --git a/src/plugins/autotest/quick/quicktestframework.cpp b/src/plugins/autotest/quick/quicktestframework.cpp index 1a72669ae8..fdb5e30cb4 100644 --- a/src/plugins/autotest/quick/quicktestframework.cpp +++ b/src/plugins/autotest/quick/quicktestframework.cpp @@ -28,6 +28,7 @@ #include "quicktesttreeitem.h" #include "../autotestconstants.h" +#include "../autotesttr.h" #include "../testframeworkmanager.h" #include "../qtest/qttestconstants.h" @@ -52,7 +53,7 @@ const char *QuickTestFramework::name() const QString QuickTestFramework::displayName() const { - return QCoreApplication::translate("QuickTestFramework", "Quick Test"); + return Tr::tr("Quick Test"); } unsigned QuickTestFramework::priority() const diff --git a/src/plugins/autotest/quick/quicktestparser.cpp b/src/plugins/autotest/quick/quicktestparser.cpp index e6b24f7275..f35a390e3f 100644 --- a/src/plugins/autotest/quick/quicktestparser.cpp +++ b/src/plugins/autotest/quick/quicktestparser.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "quicktestparser.h" -#include "quicktestframework.h" + #include "quicktesttreeitem.h" #include "quicktestvisitors.h" #include "quicktest_utils.h" diff --git a/src/plugins/autotest/quick/quicktesttreeitem.cpp b/src/plugins/autotest/quick/quicktesttreeitem.cpp index 18b576704b..a6cd7e235b 100644 --- a/src/plugins/autotest/quick/quicktesttreeitem.cpp +++ b/src/plugins/autotest/quick/quicktesttreeitem.cpp @@ -24,10 +24,11 @@ ****************************************************************************/ #include "quicktesttreeitem.h" + #include "quicktestconfiguration.h" -#include "quicktestframework.h" #include "quicktestparser.h" -#include "../testframeworkmanager.h" +#include "../autotesttr.h" +#include "../itestframework.h" #include <cppeditor/cppmodelmanager.h> #include <projectexplorer/session.h> @@ -36,7 +37,7 @@ namespace Autotest { namespace Internal { -QSet<QString> internalTargets(const Utils::FilePath &proFile); +static QSet<QString> internalTargets(const Utils::FilePath &proFile); TestTreeItem *QuickTestTreeItem::copyWithoutChildren() { @@ -50,14 +51,14 @@ QVariant QuickTestTreeItem::data(int column, int role) const switch (role) { case Qt::DisplayRole: if (type() == TestCase && name().isEmpty()) - return QCoreApplication::translate("QuickTestTreeItem", "<unnamed>"); + return Tr::tr("<unnamed>"); break; case Qt::ToolTipRole: if (type() == TestCase && name().isEmpty()) - return QCoreApplication::translate("QuickTestTreeItem", - "<p>Give all test cases a name to ensure correct " - "behavior when running test cases and to be able to " - "select them.</p>"); + return QString("<p>" + + Tr::tr("Give all test cases a name to ensure correct " + "behavior when running test cases and to be able to select them") + + "</p>"); break; case Qt::CheckStateRole: switch (type()) { diff --git a/src/plugins/autotest/testcodeparser.cpp b/src/plugins/autotest/testcodeparser.cpp index 7d0a77d839..dfed2f6703 100644 --- a/src/plugins/autotest/testcodeparser.cpp +++ b/src/plugins/autotest/testcodeparser.cpp @@ -26,8 +26,7 @@ #include "testcodeparser.h" #include "autotestconstants.h" -#include "testframeworkmanager.h" -#include "testsettings.h" +#include "autotesttr.h" #include "testtreemodel.h" #include <coreplugin/editormanager/editormanager.h> @@ -366,7 +365,7 @@ void TestCodeParser::scanForTests(const Utils::FilePaths &fileList, QThread::LowestPriority); m_futureWatcher.setFuture(future); if (list.size() > 5) { - Core::ProgressManager::addTask(future, tr("Scanning for Tests"), + Core::ProgressManager::addTask(future, Tr::tr("Scanning for Tests"), Autotest::Constants::TASK_PARSE); } } diff --git a/src/plugins/autotest/testframeworkmanager.cpp b/src/plugins/autotest/testframeworkmanager.cpp index 2d3b750883..5e4d5b54bd 100644 --- a/src/plugins/autotest/testframeworkmanager.cpp +++ b/src/plugins/autotest/testframeworkmanager.cpp @@ -25,7 +25,6 @@ #include "testframeworkmanager.h" -#include "autotestconstants.h" #include "autotestplugin.h" #include "testsettings.h" diff --git a/src/plugins/autotest/testnavigationwidget.cpp b/src/plugins/autotest/testnavigationwidget.cpp index aca619786b..908bbb2060 100644 --- a/src/plugins/autotest/testnavigationwidget.cpp +++ b/src/plugins/autotest/testnavigationwidget.cpp @@ -27,6 +27,7 @@ #include "autotestconstants.h" #include "autotesticons.h" +#include "autotesttr.h" #include "testcodeparser.h" #include "testframeworkmanager.h" #include "testrunner.h" @@ -59,7 +60,7 @@ namespace Internal { TestNavigationWidget::TestNavigationWidget(QWidget *parent) : QWidget(parent) { - setWindowTitle(tr("Tests")); + setWindowTitle(Tr::tr("Tests")); m_model = TestTreeModel::instance(); m_sortFilterModel = new TestTreeSortFilterModel(m_model, m_model); m_sortFilterModel->setDynamicSortFilter(true); @@ -78,7 +79,7 @@ TestNavigationWidget::TestNavigationWidget(QWidget *parent) : m_missingFrameworksWidget->setAutoFillBackground(true); QHBoxLayout *hLayout = new QHBoxLayout; m_missingFrameworksWidget->setLayout(hLayout); - hLayout->addWidget(new QLabel(tr("No active test frameworks."))); + hLayout->addWidget(new QLabel(Tr::tr("No active test frameworks."))); const bool hasActiveFrameworks = Utils::anyOf(TestFrameworkManager::registeredFrameworks(), &ITestFramework::active); m_missingFrameworksWidget->setVisible(!hasActiveFrameworks); @@ -141,13 +142,13 @@ void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event) ITestTreeItem *item = static_cast<ITestTreeItem *>( m_model->itemForIndex(m_sortFilterModel->mapToSource(index))); if (item->canProvideTestConfiguration()) { - runThisTest = new QAction(tr("Run This Test"), &menu); + runThisTest = new QAction(Tr::tr("Run This Test"), &menu); runThisTest->setEnabled(enabled); connect(runThisTest, &QAction::triggered, this, [this] () { onRunThisTestTriggered(TestRunMode::Run); }); - runWithoutDeploy = new QAction(tr("Run Without Deployment"), &menu); + runWithoutDeploy = new QAction(Tr::tr("Run Without Deployment"), &menu); runWithoutDeploy->setEnabled(enabled); connect(runWithoutDeploy, &QAction::triggered, this, [this] () { @@ -158,13 +159,13 @@ void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event) ? static_cast<TestTreeItem *>(item) : nullptr; if (ttitem && ttitem->canProvideDebugConfiguration()) { - debugThisTest = new QAction(tr("Debug This Test"), &menu); + debugThisTest = new QAction(Tr::tr("Debug This Test"), &menu); debugThisTest->setEnabled(enabled); connect(debugThisTest, &QAction::triggered, this, [this] () { onRunThisTestTriggered(TestRunMode::Debug); }); - debugWithoutDeploy = new QAction(tr("Debug Without Deployment"), &menu); + debugWithoutDeploy = new QAction(Tr::tr("Debug Without Deployment"), &menu); debugWithoutDeploy->setEnabled(enabled); connect(debugWithoutDeploy, &QAction::triggered, this, [this] () { @@ -178,8 +179,8 @@ void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event) QAction *runSelected = Core::ActionManager::command(Constants::ACTION_RUN_SELECTED_ID)->action(); QAction *runAllNoDeploy = Core::ActionManager::command(Constants::ACTION_RUN_ALL_NODEPLOY_ID)->action(); QAction *runSelectedNoDeploy = Core::ActionManager::command(Constants::ACTION_RUN_SELECTED_NODEPLOY_ID)->action(); - QAction *selectAll = new QAction(tr("Select All"), &menu); - QAction *deselectAll = new QAction(tr("Deselect All"), &menu); + QAction *selectAll = new QAction(Tr::tr("Select All"), &menu); + QAction *deselectAll = new QAction(Tr::tr("Deselect All"), &menu); // TODO remove? QAction *rescan = Core::ActionManager::command(Constants::ACTION_SCAN_ID)->action(); @@ -216,7 +217,7 @@ QList<QToolButton *> TestNavigationWidget::createToolButtons() m_filterButton = new QToolButton(m_view); m_filterButton->setIcon(Utils::Icons::FILTER.icon()); - m_filterButton->setToolTip(tr("Filter Test Tree")); + m_filterButton->setToolTip(Tr::tr("Filter Test Tree")); m_filterButton->setProperty("noArrow", true); m_filterButton->setPopupMode(QToolButton::InstantPopup); m_filterMenu = new QMenu(m_filterButton); @@ -227,15 +228,15 @@ QList<QToolButton *> TestNavigationWidget::createToolButtons() m_sortAlphabetically = true; m_sort = new QToolButton(this); m_sort->setIcon(Icons::SORT_NATURALLY.icon()); - m_sort->setToolTip(tr("Sort Naturally")); + m_sort->setToolTip(Tr::tr("Sort Naturally")); QToolButton *expand = new QToolButton(this); expand->setIcon(Utils::Icons::EXPAND_TOOLBAR.icon()); - expand->setToolTip(tr("Expand All")); + expand->setToolTip(Tr::tr("Expand All")); QToolButton *collapse = new QToolButton(this); collapse->setIcon(Utils::Icons::COLLAPSE_TOOLBAR.icon()); - collapse->setToolTip(tr("Collapse All")); + collapse->setToolTip(Tr::tr("Collapse All")); connect(expand, &QToolButton::clicked, m_view, [this]() { m_view->blockSignals(true); @@ -278,11 +279,11 @@ void TestNavigationWidget::onSortClicked() { if (m_sortAlphabetically) { m_sort->setIcon(Utils::Icons::SORT_ALPHABETICALLY_TOOLBAR.icon()); - m_sort->setToolTip(tr("Sort Alphabetically")); + m_sort->setToolTip(Tr::tr("Sort Alphabetically")); m_sortFilterModel->setSortMode(TestTreeItem::Naturally); } else { m_sort->setIcon(Icons::SORT_NATURALLY.icon()); - m_sort->setToolTip(tr("Sort Naturally")); + m_sort->setToolTip(Tr::tr("Sort Naturally")); m_sortFilterModel->setSortMode(TestTreeItem::Alphabetically); } m_sortAlphabetically = !m_sortAlphabetically; @@ -308,13 +309,13 @@ void TestNavigationWidget::onParsingFinished() void TestNavigationWidget::initializeFilterMenu() { QAction *action = new QAction(m_filterMenu); - action->setText(tr("Show Init and Cleanup Functions")); + action->setText(Tr::tr("Show Init and Cleanup Functions")); action->setCheckable(true); action->setChecked(false); action->setData(TestTreeSortFilterModel::ShowInitAndCleanup); m_filterMenu->addAction(action); action = new QAction(m_filterMenu); - action->setText(tr("Show Data Functions")); + action->setText(Tr::tr("Show Data Functions")); action->setCheckable(true); action->setChecked(false); action->setData(TestTreeSortFilterModel::ShowTestData); @@ -351,7 +352,7 @@ void TestNavigationWidget::reapplyCachedExpandedState() TestNavigationWidgetFactory::TestNavigationWidgetFactory() { - setDisplayName(tr("Tests")); + setDisplayName(Tr::tr("Tests")); setId(Autotest::Constants::AUTOTEST_ID); setPriority(666); } diff --git a/src/plugins/autotest/testoutputreader.cpp b/src/plugins/autotest/testoutputreader.cpp index fcd0ace230..ed15d0fa15 100644 --- a/src/plugins/autotest/testoutputreader.cpp +++ b/src/plugins/autotest/testoutputreader.cpp @@ -25,6 +25,7 @@ #include "testoutputreader.h" +#include "autotesttr.h" #include "testresult.h" #include "testresultspane.h" #include "testtreeitem.h" @@ -93,7 +94,7 @@ void TestOutputReader::processStdError(const QByteArray &outputLine) void TestOutputReader::reportCrash() { TestResultPtr result = createDefaultResult(); - result->setDescription(tr("Test executable crashed.")); + result->setDescription(Tr::tr("Test executable crashed.")); result->setResult(ResultType::MessageFatal); m_futureInterface.reportResult(result); } diff --git a/src/plugins/autotest/testresultmodel.cpp b/src/plugins/autotest/testresultmodel.cpp index ad8b4bd177..d42c7500c7 100644 --- a/src/plugins/autotest/testresultmodel.cpp +++ b/src/plugins/autotest/testresultmodel.cpp @@ -27,7 +27,6 @@ #include "autotesticons.h" #include "autotestplugin.h" -#include "testresultdelegate.h" #include "testrunner.h" #include "testsettings.h" #include "testtreeitem.h" diff --git a/src/plugins/autotest/testresultspane.cpp b/src/plugins/autotest/testresultspane.cpp index 3c0e430953..329e146174 100644 --- a/src/plugins/autotest/testresultspane.cpp +++ b/src/plugins/autotest/testresultspane.cpp @@ -27,6 +27,7 @@ #include "autotesticons.h" #include "autotestplugin.h" +#include "autotesttr.h" #include "itestframework.h" #include "testeditormark.h" #include "testresultdelegate.h" @@ -177,7 +178,7 @@ void TestResultsPane::createToolButtons() { m_expandCollapse = new QToolButton(m_treeView); m_expandCollapse->setIcon(Utils::Icons::EXPAND_ALL_TOOLBAR.icon()); - m_expandCollapse->setToolTip(tr("Expand All")); + m_expandCollapse->setToolTip(Tr::tr("Expand All")); m_expandCollapse->setCheckable(true); m_expandCollapse->setChecked(false); connect(m_expandCollapse, &QToolButton::clicked, [this] (bool checked) { @@ -212,13 +213,13 @@ void TestResultsPane::createToolButtons() m_stopTestRun = new QToolButton(m_treeView); m_stopTestRun->setIcon(Utils::Icons::STOP_SMALL_TOOLBAR.icon()); - m_stopTestRun->setToolTip(tr("Stop Test Run")); + m_stopTestRun->setToolTip(Tr::tr("Stop Test Run")); m_stopTestRun->setEnabled(false); connect(m_stopTestRun, &QToolButton::clicked, TestRunner::instance(), &TestRunner::requestStopTestRun); m_filterButton = new QToolButton(m_treeView); m_filterButton->setIcon(Utils::Icons::FILTER.icon()); - m_filterButton->setToolTip(tr("Filter Test Results")); + m_filterButton->setToolTip(Tr::tr("Filter Test Results")); m_filterButton->setProperty("noArrow", true); m_filterButton->setPopupMode(QToolButton::InstantPopup); m_filterMenu = new QMenu(m_filterButton); @@ -227,7 +228,7 @@ void TestResultsPane::createToolButtons() m_filterButton->setMenu(m_filterMenu); m_outputToggleButton = new QToolButton(m_treeView); m_outputToggleButton->setIcon(Icons::TEXT_DISPLAY.icon()); - m_outputToggleButton->setToolTip(tr("Switch Between Visual and Text Display")); + m_outputToggleButton->setToolTip(Tr::tr("Switch Between Visual and Text Display")); m_outputToggleButton->setEnabled(true); connect(m_outputToggleButton, &QToolButton::clicked, this, &TestResultsPane::toggleOutputStyle); } @@ -333,7 +334,7 @@ QList<QWidget *> TestResultsPane::toolBarWidgets() const QString TestResultsPane::displayName() const { - return tr("Test Results"); + return Tr::tr("Test Results"); } int TestResultsPane::priorityInStatusBar() const @@ -505,15 +506,15 @@ void TestResultsPane::initializeFilterMenu() m_filterModel->toggleTestResultType(ResultType::MessageInternal); QMap<ResultType, QString> textAndType; - textAndType.insert(ResultType::Pass, tr("Pass")); - textAndType.insert(ResultType::Fail, tr("Fail")); - textAndType.insert(ResultType::ExpectedFail, tr("Expected Fail")); - textAndType.insert(ResultType::UnexpectedPass, tr("Unexpected Pass")); - textAndType.insert(ResultType::Skip, tr("Skip")); - textAndType.insert(ResultType::Benchmark, tr("Benchmarks")); - textAndType.insert(ResultType::MessageDebug, tr("Debug Messages")); - textAndType.insert(ResultType::MessageWarn, tr("Warning Messages")); - textAndType.insert(ResultType::MessageInternal, tr("Internal Messages")); + textAndType.insert(ResultType::Pass, Tr::tr("Pass")); + textAndType.insert(ResultType::Fail, Tr::tr("Fail")); + textAndType.insert(ResultType::ExpectedFail, Tr::tr("Expected Fail")); + textAndType.insert(ResultType::UnexpectedPass, Tr::tr("Unexpected Pass")); + textAndType.insert(ResultType::Skip, Tr::tr("Skip")); + textAndType.insert(ResultType::Benchmark, Tr::tr("Benchmarks")); + textAndType.insert(ResultType::MessageDebug, Tr::tr("Debug Messages")); + textAndType.insert(ResultType::MessageWarn, Tr::tr("Warning Messages")); + textAndType.insert(ResultType::MessageInternal, Tr::tr("Internal Messages")); for (auto it = textAndType.cbegin(); it != textAndType.cend(); ++it) { const ResultType &result = it.key(); QAction *action = new QAction(m_filterMenu); @@ -524,10 +525,10 @@ void TestResultsPane::initializeFilterMenu() m_filterMenu->addAction(action); } m_filterMenu->addSeparator(); - QAction *action = new QAction(tr("Check All Filters"), m_filterMenu); + QAction *action = new QAction(Tr::tr("Check All Filters"), m_filterMenu); m_filterMenu->addAction(action); connect(action, &QAction::triggered, this, [this]() { TestResultsPane::checkAllFilter(true); }); - action = new QAction(tr("Uncheck All Filters"), m_filterMenu); + action = new QAction(Tr::tr("Uncheck All Filters"), m_filterMenu); m_filterMenu->addAction(action); connect(action, &QAction::triggered, this, [this]() { TestResultsPane::checkAllFilter(false); }); } @@ -535,33 +536,33 @@ void TestResultsPane::initializeFilterMenu() void TestResultsPane::updateSummaryLabel() { QString labelText = QString("<p>"); - labelText.append(tr("Test summary")); + labelText.append(Tr::tr("Test summary")); labelText.append(": "); int count = m_model->resultTypeCount(ResultType::Pass); - labelText += QString::number(count) + ' ' + tr("passes"); + labelText += QString::number(count) + ' ' + Tr::tr("passes"); count = m_model->resultTypeCount(ResultType::Fail); - labelText += ", " + QString::number(count) + ' ' + tr("fails"); + labelText += ", " + QString::number(count) + ' ' + Tr::tr("fails"); count = m_model->resultTypeCount(ResultType::UnexpectedPass); if (count) - labelText += ", " + QString::number(count) + ' ' + tr("unexpected passes"); + labelText += ", " + QString::number(count) + ' ' + Tr::tr("unexpected passes"); count = m_model->resultTypeCount(ResultType::ExpectedFail); if (count) - labelText += ", " + QString::number(count) + ' ' + tr("expected fails"); + labelText += ", " + QString::number(count) + ' ' + Tr::tr("expected fails"); count = m_model->resultTypeCount(ResultType::MessageFatal); if (count) - labelText += ", " + QString::number(count) + ' ' + tr("fatals"); + labelText += ", " + QString::number(count) + ' ' + Tr::tr("fatals"); count = m_model->resultTypeCount(ResultType::BlacklistedFail) + m_model->resultTypeCount(ResultType::BlacklistedXFail) + m_model->resultTypeCount(ResultType::BlacklistedPass) + m_model->resultTypeCount(ResultType::BlacklistedXPass); if (count) - labelText += ", " + QString::number(count) + ' ' + tr("blacklisted"); + labelText += ", " + QString::number(count) + ' ' + Tr::tr("blacklisted"); count = m_model->resultTypeCount(ResultType::Skip); if (count) - labelText += ", " + QString::number(count) + ' ' + tr("skipped"); + labelText += ", " + QString::number(count) + ' ' + Tr::tr("skipped"); count = m_model->disabledTests(); if (count) - labelText += ", " + QString::number(count) + ' ' + tr("disabled"); + labelText += ", " + QString::number(count) + ' ' + Tr::tr("disabled"); labelText.append(".</p>"); m_summaryLabel->setText(labelText); } @@ -635,7 +636,7 @@ void TestResultsPane::onCustomContextMenuRequested(const QPoint &pos) const TestResult *clicked = getTestResult(m_treeView->indexAt(pos)); QMenu menu; - QAction *action = new QAction(tr("Copy"), &menu); + QAction *action = new QAction(Tr::tr("Copy"), &menu); action->setShortcut(QKeySequence(QKeySequence::Copy)); action->setEnabled(resultsAvailable && clicked); connect(action, &QAction::triggered, [this, clicked] () { @@ -643,32 +644,32 @@ void TestResultsPane::onCustomContextMenuRequested(const QPoint &pos) }); menu.addAction(action); - action = new QAction(tr("Copy All"), &menu); + action = new QAction(Tr::tr("Copy All"), &menu); action->setEnabled(enabled); connect(action, &QAction::triggered, this, &TestResultsPane::onCopyWholeTriggered); menu.addAction(action); - action = new QAction(tr("Save Output to File..."), &menu); + action = new QAction(Tr::tr("Save Output to File..."), &menu); action->setEnabled(enabled); connect(action, &QAction::triggered, this, &TestResultsPane::onSaveWholeTriggered); menu.addAction(action); const auto correlatingItem = (enabled && clicked) ? clicked->findTestTreeItem() : nullptr; - action = new QAction(tr("Run This Test"), &menu); + action = new QAction(Tr::tr("Run This Test"), &menu); action->setEnabled(correlatingItem && correlatingItem->canProvideTestConfiguration()); connect(action, &QAction::triggered, this, [this, clicked] { onRunThisTestTriggered(TestRunMode::Run, clicked); }); menu.addAction(action); - action = new QAction(tr("Run This Test Without Deployment"), &menu); + action = new QAction(Tr::tr("Run This Test Without Deployment"), &menu); action->setEnabled(correlatingItem && correlatingItem->canProvideTestConfiguration()); connect(action, &QAction::triggered, this, [this, clicked] { onRunThisTestTriggered(TestRunMode::RunWithoutDeploy, clicked); }); menu.addAction(action); - action = new QAction(tr("Debug This Test"), &menu); + action = new QAction(Tr::tr("Debug This Test"), &menu); bool debugEnabled = false; if (correlatingItem) { if (correlatingItem->testBase()->type() == ITestBase::Framework) { @@ -682,7 +683,7 @@ void TestResultsPane::onCustomContextMenuRequested(const QPoint &pos) }); menu.addAction(action); - action = new QAction(tr("Debug This Test Without Deployment"), &menu); + action = new QAction(Tr::tr("Debug This Test Without Deployment"), &menu); action->setEnabled(debugEnabled); connect(action, &QAction::triggered, this, [this, clicked] { onRunThisTestTriggered(TestRunMode::DebugWithoutDeploy, clicked); @@ -716,14 +717,14 @@ void TestResultsPane::onCopyWholeTriggered() void TestResultsPane::onSaveWholeTriggered() { - const FilePath filePath = FileUtils::getSaveFilePath(nullptr, tr("Save Output To")); + const FilePath filePath = FileUtils::getSaveFilePath(nullptr, Tr::tr("Save Output To")); if (filePath.isEmpty()) return; FileSaver saver(filePath, QIODevice::Text); if (!saver.write(getWholeOutput().toUtf8()) || !saver.finalize()) { - QMessageBox::critical(ICore::dialogParent(), tr("Error"), - tr("Failed to write \"%1\".\n\n%2").arg(filePath.toUserOutput()) + QMessageBox::critical(ICore::dialogParent(), Tr::tr("Error"), + Tr::tr("Failed to write \"%1\".\n\n%2").arg(filePath.toUserOutput()) .arg(saver.errorString())); } } diff --git a/src/plugins/autotest/testrunconfiguration.h b/src/plugins/autotest/testrunconfiguration.h index ccb6282059..5108b52b53 100644 --- a/src/plugins/autotest/testrunconfiguration.h +++ b/src/plugins/autotest/testrunconfiguration.h @@ -27,6 +27,8 @@ #include "testconfiguration.h" +#include "autotesttr.h" + #include <debugger/debuggerrunconfigurationaspect.h> #include <projectexplorer/devicesupport/devicemanager.h> @@ -36,20 +38,16 @@ #include <utils/qtcassert.h> -#include <QCoreApplication> - namespace Autotest { namespace Internal { class TestRunConfiguration : public ProjectExplorer::RunConfiguration { - Q_DECLARE_TR_FUNCTIONS(Autotest::Internal::TestRunConfiguration) - public: TestRunConfiguration(ProjectExplorer::Target *parent, TestConfiguration *config) : ProjectExplorer::RunConfiguration(parent, "AutoTest.TestRunConfig") { - setDefaultDisplayName(tr("AutoTest Debug")); + setDefaultDisplayName(Tr::tr("AutoTest Debug")); bool enableQuick = false; if (auto debuggable = dynamic_cast<DebuggableTestConfiguration *>(config)) diff --git a/src/plugins/autotest/testrunner.cpp b/src/plugins/autotest/testrunner.cpp index f8bf1d955d..2c882d0a68 100644 --- a/src/plugins/autotest/testrunner.cpp +++ b/src/plugins/autotest/testrunner.cpp @@ -27,6 +27,7 @@ #include "autotestconstants.h" #include "autotestplugin.h" +#include "autotesttr.h" #include "itestframework.h" #include "testoutputreader.h" #include "testprojectsettings.h" @@ -101,7 +102,7 @@ TestRunner::TestRunner() connect(&m_futureWatcher, &QFutureWatcher<TestResultPtr>::canceled, this, [this]() { cancelCurrent(UserCanceled); - reportResult(ResultType::MessageFatal, tr("Test run canceled by user.")); + reportResult(ResultType::MessageFatal, Tr::tr("Test run canceled by user.")); }); connect(BuildManager::instance(), &BuildManager::buildQueueFinished, this, &TestRunner::onBuildQueueFinished); @@ -156,16 +157,16 @@ static QString rcInfo(const ITestConfiguration * const config) const TestConfiguration *current = static_cast<const TestConfiguration *>(config); QString info; if (current->isDeduced()) - info = TestRunner::tr("\nRun configuration: deduced from \"%1\""); + info = Tr::tr("\nRun configuration: deduced from \"%1\""); else - info = TestRunner::tr("\nRun configuration: \"%1\""); + info = Tr::tr("\nRun configuration: \"%1\""); return info.arg(current->runConfigDisplayName()); } static QString constructOmittedDetailsString(const QStringList &omitted) { - return TestRunner::tr("Omitted the following arguments specified on the run " - "configuration page for \"%1\":") + '\n' + omitted.join('\n'); + return Tr::tr("Omitted the following arguments specified on the run " + "configuration page for \"%1\":") + '\n' + omitted.join('\n'); } static QString constructOmittedVariablesDetailsString(const Utils::EnvironmentItems &diff) @@ -173,7 +174,7 @@ static QString constructOmittedVariablesDetailsString(const Utils::EnvironmentIt auto removedVars = Utils::transform<QStringList>(diff, [](const Utils::EnvironmentItem &it) { return it.name; }); - return TestRunner::tr("Omitted the following environment variables for \"%1\":") + return Tr::tr("Omitted the following environment variables for \"%1\":") + '\n' + removedVars.join('\n'); } @@ -189,7 +190,7 @@ bool TestRunner::currentConfigValid() } if (commandFilePath.isEmpty()) { reportResult(ResultType::MessageFatal, - tr("Executable path is empty. (%1)").arg(m_currentConfig->displayName())); + Tr::tr("Executable path is empty. (%1)").arg(m_currentConfig->displayName())); delete m_currentConfig; m_currentConfig = nullptr; if (m_selectedTests.isEmpty()) { @@ -297,9 +298,9 @@ void TestRunner::cancelCurrent(TestRunner::CancelReason reason) m_fakeFutureInterface->reportCanceled(); if (reason == KitChanged) - reportResult(ResultType::MessageWarn, tr("Current kit has changed. Canceling test run.")); + reportResult(ResultType::MessageWarn, Tr::tr("Current kit has changed. Canceling test run.")); else if (reason == Timeout) - reportResult(ResultType::MessageFatal, tr("Test case canceled due to timeout.\nMaybe raise the timeout?")); + reportResult(ResultType::MessageFatal, Tr::tr("Test case canceled due to timeout.\nMaybe raise the timeout?")); // if user or timeout cancels the current run ensure to kill the running process if (m_currentProcess && m_currentProcess->state() != QProcess::NotRunning) { @@ -312,7 +313,7 @@ void TestRunner::onProcessDone() { if (m_currentProcess->result() == ProcessResult::StartFailed) { reportResult(ResultType::MessageFatal, - tr("Failed to start test for project \"%1\".").arg(m_currentConfig->displayName()) + Tr::tr("Failed to start test for project \"%1\".").arg(m_currentConfig->displayName()) + processInformation(m_currentProcess) + rcInfo(m_currentConfig)); } @@ -325,11 +326,11 @@ void TestRunner::onProcessDone() if (m_currentOutputReader) m_currentOutputReader->reportCrash(); reportResult(ResultType::MessageFatal, - tr("Test for project \"%1\" crashed.").arg(m_currentConfig->displayName()) + Tr::tr("Test for project \"%1\" crashed.").arg(m_currentConfig->displayName()) + processInformation(m_currentProcess) + rcInfo(m_currentConfig)); } else if (m_currentOutputReader && !m_currentOutputReader->hadValidOutput()) { reportResult(ResultType::MessageFatal, - tr("Test for project \"%1\" did not produce any expected output.") + Tr::tr("Test for project \"%1\" did not produce any expected output.") .arg(m_currentConfig->displayName()) + processInformation(m_currentProcess) + rcInfo(m_currentConfig)); } @@ -390,7 +391,7 @@ void TestRunner::prepareToRunTests(TestRunMode mode) TestTreeModel::instance()->clearFailedMarks(); if (m_selectedTests.empty()) { - reportResult(ResultType::MessageWarn, tr("No tests selected. Canceling test run.")); + reportResult(ResultType::MessageWarn, Tr::tr("No tests selected. Canceling test run.")); onFinished(); return; } @@ -398,9 +399,9 @@ void TestRunner::prepareToRunTests(TestRunMode mode) Project *project = m_selectedTests.at(0)->project(); if (!project) { reportResult(ResultType::MessageWarn, - tr("Project is null. Canceling test run.\n" - "Only desktop kits are supported. Make sure the " - "currently active kit is a desktop kit.")); + Tr::tr("Project is null. Canceling test run.\n" + "Only desktop kits are supported. Make sure the " + "currently active kit is a desktop kit.")); onFinished(); return; } @@ -420,7 +421,7 @@ void TestRunner::prepareToRunTests(TestRunMode mode) buildProject(project); } else { reportResult(ResultType::MessageFatal, - tr("Project is not configured. Canceling test run.")); + Tr::tr("Project is not configured. Canceling test run.")); onFinished(); } } @@ -488,8 +489,8 @@ int TestRunner::precheckTestConfigurations() testCaseCount += itc->testCaseCount(); } else { reportResult(ResultType::MessageWarn, - tr("Project is null for \"%1\". Removing from test run.\n" - "Check the test environment.").arg(itc->displayName())); + Tr::tr("Project is null for \"%1\". Removing from test run.\n" + "Check the test environment.").arg(itc->displayName())); } continue; } @@ -498,7 +499,7 @@ int TestRunner::precheckTestConfigurations() if (config->project()) { testCaseCount += config->testCaseCount(); if (!omitWarnings && config->isDeduced()) { - QString message = tr( + QString message = Tr::tr( "Project's run configuration was deduced for \"%1\".\n" "This might cause trouble during execution.\n" "(deduced from \"%2\")"); @@ -507,8 +508,8 @@ int TestRunner::precheckTestConfigurations() } } else { reportResult(ResultType::MessageWarn, - tr("Project is null for \"%1\". Removing from test run.\n" - "Check the test environment.").arg(config->displayName())); + Tr::tr("Project is null for \"%1\". Removing from test run.\n" + "Check the test environment.").arg(config->displayName())); } } return testCaseCount; @@ -554,8 +555,8 @@ void TestRunner::runTests() qDeleteAll(toBeRemoved); toBeRemoved.clear(); if (m_selectedTests.isEmpty()) { - QString mssg = projectChanged ? tr("Startup project has changed. Canceling test run.") - : tr("No test cases left for execution. Canceling test run."); + QString mssg = projectChanged ? Tr::tr("Startup project has changed. Canceling test run.") + : Tr::tr("No test cases left for execution. Canceling test run."); reportResult(ResultType::MessageWarn, mssg); onFinished(); @@ -571,7 +572,7 @@ void TestRunner::runTests() m_fakeFutureInterface->setProgressValue(0); m_futureWatcher.setFuture(future); - Core::ProgressManager::addTask(future, tr("Running Tests"), Autotest::Constants::TASK_INDEX); + Core::ProgressManager::addTask(future, Tr::tr("Running Tests"), Autotest::Constants::TASK_INDEX); if (AutotestPlugin::settings()->popupOnStart) AutotestPlugin::popupResultsPane(); scheduleNext(); @@ -616,7 +617,7 @@ void TestRunner::debugTests() config->completeTestInformation(TestRunMode::Debug); if (!config->project()) { reportResult(ResultType::MessageWarn, - tr("Startup project has changed. Canceling test run.")); + Tr::tr("Startup project has changed. Canceling test run.")); onFinished(); return; } @@ -626,14 +627,14 @@ void TestRunner::debugTests() } if (!config->runConfiguration()) { - reportResult(ResultType::MessageFatal, tr("Failed to get run configuration.")); + reportResult(ResultType::MessageFatal, Tr::tr("Failed to get run configuration.")); onFinished(); return; } const Utils::FilePath &commandFilePath = config->executableFilePath(); if (commandFilePath.isEmpty()) { - reportResult(ResultType::MessageFatal, tr("Could not find command \"%1\". (%2)") + reportResult(ResultType::MessageFatal, Tr::tr("Could not find command \"%1\". (%2)") .arg(config->executableFilePath().toString(), config->displayName())); onFinished(); return; @@ -671,7 +672,7 @@ void TestRunner::debugTests() if (Target *targ = config->project()->activeTarget()) { if (Debugger::DebuggerKitAspect::engineType(targ->kit()) == Debugger::CdbEngineType) { reportResult(ResultType::MessageWarn, - tr("Unable to display test results when using CDB.")); + Tr::tr("Unable to display test results when using CDB.")); useOutputProcessor = false; } } @@ -775,7 +776,7 @@ void TestRunner::buildFinished(bool success) else if (m_executingTests) onFinished(); } else { - reportResult(ResultType::MessageFatal, tr("Build failed. Canceling test run.")); + reportResult(ResultType::MessageFatal, Tr::tr("Build failed. Canceling test run.")); onFinished(); } } @@ -853,15 +854,15 @@ RunConfigurationSelectionDialog::RunConfigurationSelectionDialog(const QString & QWidget *parent) : QDialog(parent) { - setWindowTitle(tr("Select Run Configuration")); + setWindowTitle(Tr::tr("Select Run Configuration")); - QString details = tr("Could not determine which run configuration to choose for running tests"); + QString details = Tr::tr("Could not determine which run configuration to choose for running tests"); if (!buildTargetKey.isEmpty()) details.append(QString(" (%1)").arg(buildTargetKey)); m_details = new QLabel(details, this); m_rcCombo = new QComboBox(this); - m_rememberCB = new QCheckBox(tr("Remember choice. Cached choices can be reset by switching " - "projects or using the option to clear the cache."), this); + m_rememberCB = new QCheckBox(Tr::tr("Remember choice. Cached choices can be reset by switching " + "projects or using the option to clear the cache."), this); m_executable = new QLabel(this); m_arguments = new QLabel(this); m_workingDir = new QLabel(this); @@ -872,12 +873,12 @@ RunConfigurationSelectionDialog::RunConfigurationSelectionDialog(const QString & auto formLayout = new QFormLayout; formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); formLayout->addRow(m_details); - formLayout->addRow(tr("Run Configuration:"), m_rcCombo); + formLayout->addRow(Tr::tr("Run Configuration:"), m_rcCombo); formLayout->addRow(m_rememberCB); formLayout->addRow(createLine(this)); - formLayout->addRow(tr("Executable:"), m_executable); - formLayout->addRow(tr("Arguments:"), m_arguments); - formLayout->addRow(tr("Working Directory:"), m_workingDir); + formLayout->addRow(Tr::tr("Executable:"), m_executable); + formLayout->addRow(Tr::tr("Arguments:"), m_arguments); + formLayout->addRow(Tr::tr("Working Directory:"), m_workingDir); // TODO Device support auto vboxLayout = new QVBoxLayout(this); vboxLayout->addLayout(formLayout); diff --git a/src/plugins/autotest/testsettingspage.cpp b/src/plugins/autotest/testsettingspage.cpp index 92c4754f06..6abb3e7870 100644 --- a/src/plugins/autotest/testsettingspage.cpp +++ b/src/plugins/autotest/testsettingspage.cpp @@ -27,6 +27,7 @@ #include "autotestconstants.h" #include "autotestplugin.h" +#include "autotesttr.h" #include "testframeworkmanager.h" #include "testsettings.h" #include "testtreemodel.h" @@ -57,8 +58,6 @@ namespace Internal { class TestSettingsWidget : public QWidget { - Q_DECLARE_TR_FUNCTIONS(Autotest::Internal::TestSettingsWidget) - public: explicit TestSettingsWidget(QWidget *parent = nullptr); @@ -94,21 +93,21 @@ TestSettingsWidget::TestSettingsWidget(QWidget *parent) { resize(586, 469); - m_omitInternalMsgCB = new QCheckBox(tr("Omit internal messages")); + m_omitInternalMsgCB = new QCheckBox(Tr::tr("Omit internal messages")); m_omitInternalMsgCB->setChecked(true); - m_omitInternalMsgCB->setToolTip(tr("Hides internal messages by default. " + m_omitInternalMsgCB->setToolTip(Tr::tr("Hides internal messages by default. " "You can still enable them by using the test results filter.")); - m_omitRunConfigWarnCB = new QCheckBox(tr("Omit run configuration warnings")); - m_omitRunConfigWarnCB->setToolTip(tr("Hides warnings related to a deduced run configuration.")); + m_omitRunConfigWarnCB = new QCheckBox(Tr::tr("Omit run configuration warnings")); + m_omitRunConfigWarnCB->setToolTip(Tr::tr("Hides warnings related to a deduced run configuration.")); - m_limitResultOutputCB = new QCheckBox(tr("Limit result output")); + m_limitResultOutputCB = new QCheckBox(Tr::tr("Limit result output")); m_limitResultOutputCB->setChecked(true); - m_limitResultOutputCB->setToolTip(tr("Limits result output to 100000 characters.")); + m_limitResultOutputCB->setToolTip(Tr::tr("Limits result output to 100000 characters.")); - m_limitResultDescriptionCb = new QCheckBox(tr("Limit result description:")); + m_limitResultDescriptionCb = new QCheckBox(Tr::tr("Limit result description:")); m_limitResultDescriptionCb->setToolTip( - tr("Limit number of lines shown in test result tooltip and description.")); + Tr::tr("Limit number of lines shown in test result tooltip and description.")); m_limitResultDescriptionSpinBox = new QSpinBox; m_limitResultDescriptionSpinBox->setEnabled(false); @@ -116,64 +115,64 @@ TestSettingsWidget::TestSettingsWidget(QWidget *parent) m_limitResultDescriptionSpinBox->setMaximum(1000000); m_limitResultDescriptionSpinBox->setValue(10); - m_openResultsOnStartCB = new QCheckBox(tr("Open results when tests start")); + m_openResultsOnStartCB = new QCheckBox(Tr::tr("Open results when tests start")); m_openResultsOnStartCB->setToolTip( - tr("Displays test results automatically when tests are started.")); + Tr::tr("Displays test results automatically when tests are started.")); - m_openResultsOnFinishCB = new QCheckBox(tr("Open results when tests finish")); + m_openResultsOnFinishCB = new QCheckBox(Tr::tr("Open results when tests finish")); m_openResultsOnFinishCB->setChecked(true); m_openResultsOnFinishCB->setToolTip( - tr("Displays test results automatically when tests are finished.")); + Tr::tr("Displays test results automatically when tests are finished.")); - m_openResultsOnFailCB = new QCheckBox(tr("Only for unsuccessful test runs")); + m_openResultsOnFailCB = new QCheckBox(Tr::tr("Only for unsuccessful test runs")); m_openResultsOnFailCB->setToolTip( - tr("Displays test results only if the test run contains failed, fatal or unexpectedly passed tests.")); + Tr::tr("Displays test results only if the test run contains failed, fatal or unexpectedly passed tests.")); - m_autoScrollCB = new QCheckBox(tr("Automatically scroll results")); + m_autoScrollCB = new QCheckBox(Tr::tr("Automatically scroll results")); m_autoScrollCB->setChecked(true); - m_autoScrollCB->setToolTip(tr("Automatically scrolls down when new items are added and scrollbar is at bottom.")); + m_autoScrollCB->setToolTip(Tr::tr("Automatically scrolls down when new items are added and scrollbar is at bottom.")); - m_displayAppCB = new QCheckBox(tr("Group results by application")); + m_displayAppCB = new QCheckBox(Tr::tr("Group results by application")); - m_processArgsCB = new QCheckBox(tr("Process arguments")); + m_processArgsCB = new QCheckBox(Tr::tr("Process arguments")); m_processArgsCB->setToolTip( - tr("Allow passing arguments specified on the respective run configuration.\n" + Tr::tr("Allow passing arguments specified on the respective run configuration.\n" "Warning: this is an experimental feature and might lead to failing to execute the test executable.")); m_runAfterBuildCB = new QComboBox; - m_runAfterBuildCB->setToolTip(tr("Runs chosen tests automatically if a build succeeded.")); - m_runAfterBuildCB->addItem(tr("None")); - m_runAfterBuildCB->addItem(tr("All")); - m_runAfterBuildCB->addItem(tr("Selected")); + m_runAfterBuildCB->setToolTip(Tr::tr("Runs chosen tests automatically if a build succeeded.")); + m_runAfterBuildCB->addItem(Tr::tr("None")); + m_runAfterBuildCB->addItem(Tr::tr("All")); + m_runAfterBuildCB->addItem(Tr::tr("Selected")); - auto timeoutLabel = new QLabel(tr("Timeout:")); - timeoutLabel->setToolTip(tr("Timeout used when executing each test case.")); + auto timeoutLabel = new QLabel(Tr::tr("Timeout:")); + timeoutLabel->setToolTip(Tr::tr("Timeout used when executing each test case.")); m_timeoutSpin = new QSpinBox; m_timeoutSpin->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); m_timeoutSpin->setRange(5, 36000); m_timeoutSpin->setValue(60); - m_timeoutSpin->setSuffix(tr(" s")); + m_timeoutSpin->setSuffix(Tr::tr(" s")); m_timeoutSpin->setToolTip( - tr("Timeout used when executing test cases. This will apply " - "for each test case on its own, not the whole project.")); + Tr::tr("Timeout used when executing test cases. This will apply " + "for each test case on its own, not the whole project.")); - auto resetChoicesButton = new QPushButton(tr("Reset Cached Choices")); + auto resetChoicesButton = new QPushButton(Tr::tr("Reset Cached Choices")); resetChoicesButton->setToolTip( - tr("Clear all cached choices of run configurations for tests where the executable could not be deduced.")); + Tr::tr("Clear all cached choices of run configurations for tests where the executable could not be deduced.")); m_frameworkTreeWidget = new QTreeWidget; m_frameworkTreeWidget->setRootIsDecorated(false); m_frameworkTreeWidget->setHeaderHidden(false); m_frameworkTreeWidget->setColumnCount(2); m_frameworkTreeWidget->header()->setDefaultSectionSize(150); - m_frameworkTreeWidget->setToolTip(tr("Selects the test frameworks to be handled by the AutoTest plugin.")); + m_frameworkTreeWidget->setToolTip(Tr::tr("Selects the test frameworks to be handled by the AutoTest plugin.")); QTreeWidgetItem *item = m_frameworkTreeWidget->headerItem(); - item->setText(0, tr("Framework")); - item->setToolTip(0, tr("Selects the test frameworks to be handled by the AutoTest plugin.")); - item->setText(1, tr("Group")); - item->setToolTip(1, tr("Enables grouping of test cases.")); + item->setText(0, Tr::tr("Framework")); + item->setToolTip(0, Tr::tr("Selects the test frameworks to be handled by the AutoTest plugin.")); + item->setText(1, Tr::tr("Group")); + item->setToolTip(1, Tr::tr("Enables grouping of test cases.")); m_frameworksWarn = new Utils::InfoLabel; m_frameworksWarn->setVisible(false); @@ -183,7 +182,7 @@ TestSettingsWidget::TestSettingsWidget(QWidget *parent) using namespace Utils::Layouting; Group generalGroup { - title(tr("General")), + title(Tr::tr("General")), Column { m_omitInternalMsgCB, m_omitRunConfigWarnCB, @@ -195,14 +194,14 @@ TestSettingsWidget::TestSettingsWidget(QWidget *parent) m_autoScrollCB, m_displayAppCB, m_processArgsCB, - Row { new QLabel(tr("Automatically run")), m_runAfterBuildCB, st }, + Row { Tr::tr("Automatically run"), m_runAfterBuildCB, st }, Row { timeoutLabel, m_timeoutSpin, st }, Row { resetChoicesButton, st } } }; Group activeFrameworks { - title(tr("Active Test Frameworks")), + title(Tr::tr("Active Test Frameworks")), Column { m_frameworkTreeWidget, m_frameworksWarn, @@ -286,11 +285,11 @@ void TestSettingsWidget::populateFrameworksListWidget(const QHash<Utils::Id, boo item->setData(0, BaseId, id.toSetting()); item->setData(0, BaseType, ITestBase::Framework); item->setData(1, Qt::CheckStateRole, framework->grouping() ? Qt::Checked : Qt::Unchecked); - item->setToolTip(0, tr("Enable or disable test frameworks to be handled by the AutoTest " - "plugin.")); + item->setToolTip(0, Tr::tr("Enable or disable test frameworks to be handled by the " + "AutoTest plugin.")); QString toolTip = framework->groupingToolTip(); if (toolTip.isEmpty()) - toolTip = tr("Enable or disable grouping of test cases by folder."); + toolTip = Tr::tr("Enable or disable grouping of test cases by folder."); item->setToolTip(1, toolTip); } // ...and now the test tools @@ -351,13 +350,13 @@ void TestSettingsWidget::onFrameworkItemChanged() if (!atLeastOneEnabled || (mixed == (ITestBase::Framework | ITestBase::Tool))) { if (!atLeastOneEnabled) { - m_frameworksWarn->setText(tr("No active test frameworks or tools.")); - m_frameworksWarn->setToolTip(tr("You will not be able to use the AutoTest plugin " - "without having at least one active test framework.")); + m_frameworksWarn->setText(Tr::tr("No active test frameworks or tools.")); + m_frameworksWarn->setToolTip(Tr::tr("You will not be able to use the AutoTest plugin " + "without having at least one active test framework.")); } else { - m_frameworksWarn->setText(tr("Mixing test frameworks and test tools.")); - m_frameworksWarn->setToolTip(tr("Mixing test frameworks and test tools can lead " - "to duplicating run information when using " + m_frameworksWarn->setText(Tr::tr("Mixing test frameworks and test tools.")); + m_frameworksWarn->setToolTip(Tr::tr("Mixing test frameworks and test tools can lead " + "to duplicating run information when using " "\"Run All Tests\", for example.")); } } @@ -369,9 +368,9 @@ TestSettingsPage::TestSettingsPage(TestSettings *settings) : m_settings(settings) { setId(Constants::AUTOTEST_SETTINGS_ID); - setDisplayName(tr("General")); + setDisplayName(Tr::tr("General")); setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY); - setDisplayCategory(QCoreApplication::translate("AutoTest", Constants::AUTOTEST_SETTINGS_TR)); + setDisplayCategory(Tr::tr("Testing")); setCategoryIconPath(":/autotest/images/settingscategory_autotest.png"); } diff --git a/src/plugins/autotest/testtreeitem.cpp b/src/plugins/autotest/testtreeitem.cpp index 20c46076c6..5414a9e2f0 100644 --- a/src/plugins/autotest/testtreeitem.cpp +++ b/src/plugins/autotest/testtreeitem.cpp @@ -26,6 +26,7 @@ #include "testtreeitem.h" #include "autotestconstants.h" +#include "autotesttr.h" #include "itestframework.h" #include "itestparser.h" #include "testconfiguration.h" @@ -66,9 +67,8 @@ QVariant ITestTreeItem::data(int /*column*/, int role) const switch (role) { case Qt::DisplayRole: if (m_type == Root && childCount() == 0) - return QCoreApplication::translate("TestTreeItem", "%1 (none)").arg(m_name); - else - return m_name; + return Tr::tr("%1 (none)").arg(m_name); + return m_name; case Qt::ToolTipRole: return m_filePath.toString(); case Qt::DecorationRole: diff --git a/src/plugins/autotest/testtreemodel.cpp b/src/plugins/autotest/testtreemodel.cpp index d4a6c09f0b..13e227b529 100644 --- a/src/plugins/autotest/testtreemodel.cpp +++ b/src/plugins/autotest/testtreemodel.cpp @@ -30,7 +30,6 @@ #include "testcodeparser.h" #include "testframeworkmanager.h" #include "testprojectsettings.h" -#include "testsettings.h" #include <cppeditor/cppmodelmanager.h> #include <projectexplorer/buildsystem.h> |