From f7bcd4f574491211d73752fb953e5af099dcac0c Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 11 Jan 2023 20:43:10 +0100 Subject: [PATCH] CppEditor: Convert to Tr::tr Change-Id: Ic4025e06e17c45eb6dc2162fb7f21f5b8aebe84d Reviewed-by: Alessandro Portale Reviewed-by: --- share/qtcreator/translations/qtcreator_cs.ts | 153 +--------- share/qtcreator/translations/qtcreator_da.ts | 71 +---- share/qtcreator/translations/qtcreator_de.ts | 164 ++--------- share/qtcreator/translations/qtcreator_es.ts | 17 +- share/qtcreator/translations/qtcreator_fr.ts | 152 +--------- share/qtcreator/translations/qtcreator_hr.ts | 69 +---- share/qtcreator/translations/qtcreator_hu.ts | 20 +- share/qtcreator/translations/qtcreator_it.ts | 17 +- share/qtcreator/translations/qtcreator_ja.ts | 70 +---- share/qtcreator/translations/qtcreator_pl.ts | 61 +--- share/qtcreator/translations/qtcreator_ru.ts | 72 +---- share/qtcreator/translations/qtcreator_sl.ts | 48 +--- share/qtcreator/translations/qtcreator_uk.ts | 84 +----- .../qtcreator/translations/qtcreator_zh_CN.ts | 175 +----------- .../qtcreator/translations/qtcreator_zh_TW.ts | 41 +-- .../cppeditor/abstracteditorsupport.cpp | 5 +- .../cppeditor/baseeditordocumentprocessor.h | 3 +- .../clangdiagnosticconfigsselectionwidget.cpp | 5 +- .../clangdiagnosticconfigswidget.cpp | 47 ++-- src/plugins/cppeditor/cppchecksymbols.cpp | 16 +- .../cppeditor/cppcodemodelinspectordialog.cpp | 5 +- .../cppeditor/cppcodemodelsettings.cpp | 9 +- .../cppeditor/cppcodemodelsettingspage.cpp | 83 +++--- .../cppeditor/cppcodestylesettingspage.cpp | 157 ++++++----- src/plugins/cppeditor/cppeditorconstants.h | 4 - src/plugins/cppeditor/cppeditordocument.cpp | 9 +- src/plugins/cppeditor/cppeditoroutline.cpp | 3 +- src/plugins/cppeditor/cppeditorplugin.cpp | 77 +++--- src/plugins/cppeditor/cppeditorwidget.cpp | 14 +- src/plugins/cppeditor/cppfilesettingspage.cpp | 43 ++- src/plugins/cppeditor/cppfindreferences.cpp | 25 +- .../cppeditor/cppfunctiondecldeflink.cpp | 7 +- .../cppeditor/cppfunctiondecldeflink.h | 1 - src/plugins/cppeditor/cppincludehierarchy.cpp | 19 +- src/plugins/cppeditor/cppincludesfilter.cpp | 7 +- src/plugins/cppeditor/cppincludesfilter.h | 2 - src/plugins/cppeditor/cppindexingsupport.cpp | 3 +- .../cppeditor/cppinsertvirtualmethods.cpp | 30 +- src/plugins/cppeditor/cppmodelmanager.cpp | 7 +- src/plugins/cppeditor/cppoutline.cpp | 7 +- src/plugins/cppeditor/cppoutlinemodel.cpp | 4 +- src/plugins/cppeditor/cppparsecontext.cpp | 15 +- .../cppeditor/cpppreprocessordialog.cpp | 5 +- .../cppeditor/cppprojectinfogenerator.cpp | 5 +- src/plugins/cppeditor/cppprojectupdater.cpp | 3 +- src/plugins/cppeditor/cppquickfixes.cpp | 261 ++++++++---------- .../cppeditor/cppquickfixprojectsettings.cpp | 21 +- .../cppquickfixprojectsettingswidget.cpp | 11 +- src/plugins/cppeditor/cppquickfixsettings.cpp | 1 + .../cppeditor/cppquickfixsettingspage.cpp | 9 +- .../cppeditor/cppquickfixsettingswidget.cpp | 116 ++++---- src/plugins/cppeditor/cppsourceprocessor.cpp | 9 +- src/plugins/cppeditor/cpptoolsreuse.cpp | 12 +- src/plugins/cppeditor/cpptoolssettings.cpp | 9 +- src/plugins/cppeditor/cpptypehierarchy.cpp | 23 +- .../cppvirtualfunctionassistprovider.cpp | 4 +- src/plugins/cppeditor/symbolsfindfilter.cpp | 31 ++- 57 files changed, 664 insertions(+), 1677 deletions(-) diff --git a/share/qtcreator/translations/qtcreator_cs.ts b/share/qtcreator/translations/qtcreator_cs.ts index 4d7e01c4bd9..ae7583a8d24 100644 --- a/share/qtcreator/translations/qtcreator_cs.ts +++ b/share/qtcreator/translations/qtcreator_cs.ts @@ -2196,15 +2196,11 @@ Chcete je nechat přepsat? - CppEditor::Internal::CPPEditor + CppEditor Sort alphabetically Roztřídit podle abecedy - - Sort Alphabetically - Roztřídit podle abecedy - This change cannot be undone. Tuto změnu nelze vrátit zpět. @@ -2213,13 +2209,6 @@ Chcete je nechat přepsat? Yes, I know what I am doing. Ano, vím, co dělám. - - Unused variable - Nepoužívaná proměnná - - - - CppEditor::Internal::ClassNamePage Enter class name Zadejte název třídy @@ -2236,16 +2225,10 @@ Chcete je nechat přepsat? Configure... Nastavení... - - - CppEditor::Internal::CppClassWizard Error while generating file contents. Chyba při vytváření souboru. - - - CppEditor::Internal::CppClassWizardDialog C++ Class Wizard Průvodce pro novou třídu C++ @@ -2254,24 +2237,10 @@ Chcete je nechat přepsat? Details Podrobnosti - - - CppEditor::Internal::CppHoverHandler Unfiltered Nezpracovaný - - - CppEditor::Internal::CppPlugin - - C++ - C++ - - - C++ Header File - Hlavičkový soubor C++ - Creates a C++ header file. Vytvoří nový hlavičkový soubor C++. @@ -2280,14 +2249,6 @@ Chcete je nechat přepsat? Creates a C++ source file. Vytvoří nový zdrojový soubor C++. - - C++ Source File - Zdrojový soubor C++ - - - C++ Class - Třída C++ - Creates a header and a source file for a new class. Vytvoří nový hlavičkový a zdrojový soubor C++ pro novou třídu. @@ -2300,70 +2261,10 @@ Chcete je nechat přepsat? Switch between Method Declaration/Definition Přepínání mezi prohlášením a vymezením postupu - - Creates a C++ header and a source file for a new class that you can add to a C++ project. - Vytvoří hlavičku C++ a zdrojový soubor pro novou třídu, který můžete přidat do projektu C++. - - - Creates a C++ source file that you can add to a C++ project. - Vytvoří zdrojový soubor pro novou třídu, který můžete přidat do projektu C++. - - - Creates a C++ header file that you can add to a C++ project. - Vytvoří hlavičkový soubor C++, který můžete přidat do projektu C++. - Follow Symbol Under Cursor Následovat symbol pod ukazovátkem - - Switch Between Method Declaration/Definition - Přepínání mezi deklarací a definicí metody - - - Shift+F2 - Shift+F2 - - - Open Method Declaration/Definition in Next Split - Otevřít deklaraci/definici metody v dalším rozdělení - - - Ctrl+E, Shift+F2 - Ctrl+E, Shift+F2 - - - Find Usages - Najít použití - - - Ctrl+Shift+U - Ctrl+Shift+U - - - Open Type Hierarchy - Otevřít hierarchii tříd - - - Ctrl+Shift+T - Ctrl+Shift+T - - - Meta+Shift+T - Meta+Shift+T - - - Rename Symbol Under Cursor - Přejmenovat symbol pod ukazovátkem - - - CTRL+SHIFT+R - Ctrl+Shift+R - - - Update Code Model - Obnovit model kódu - Rename Symbol under Cursor Přejmenovat symbol pod ukazovátkem @@ -33119,7 +33020,7 @@ správy verzí (%2) - CppEditor::Internal::CPPEditorWidget + CppEditor Sort Alphabetically Roztřídit podle abecedy @@ -33132,16 +33033,10 @@ správy verzí (%2) Unused variable Nepoužívaná proměnná - - - CppEditor::InsertDeclOperation Add %1 Declaration Přidat deklaraci pro %1 - - - CppEditor::InsertDefOperation Add Definition in %1 Přidat definici v %1 @@ -33158,9 +33053,6 @@ správy verzí (%2) Add Definition Outside Class Přidat definici vně třídy - - - CppEditor::Internal::InsertQtPropertyMembers Generate missing Q_PROPERTY members... Doplnit chybějící prvky Q_PROPERTY... @@ -33169,9 +33061,6 @@ správy verzí (%2) Generate Missing Q_PROPERTY Members... Doplnit chybějící prvky Q_PROPERTY... - - - CppEditor::Internal::CppOutlineTreeView Expand All Rozbalit vše @@ -33180,16 +33069,6 @@ správy verzí (%2) Collapse All Složit vše - - - CppEditor::Internal::CppSnippetProvider - - C++ - C++ - - - - CppEditor::Internal::CppTypeHierarchyWidget No type hierarchy available Není dostupná žádná hierarchie tříd @@ -33202,9 +33081,6 @@ správy verzí (%2) Derived Odvozené - - - CppEditor::Internal::CppTypeHierarchyFactory Type Hierarchy Hierarchie tříd @@ -46967,7 +46843,7 @@ Pro přidání verzí Qt vyberte Volby -> Sestavení a spuštění -> Verz - QuickFix::ExtractFunction + CppEditor Extract Function Vytáhnout funkci @@ -49989,7 +49865,7 @@ Nainstalujte, prosím, alespoň jedno SDK. - CppEditor::Internal::FunctionDeclDefLink + CppEditor Target file was changed, could not apply changes Změny se nepodařilo použít, protože cílový soubor byl změněn @@ -53315,7 +53191,7 @@ nelze najít v cestě. - CPlusPlus::CheckSymbols + CppEditor Only virtual methods can be marked 'final' Jen virtuální metody lze označit jako 'final' @@ -55559,7 +55435,7 @@ Lze používat části jmen, pokud jsou jednoznačné. - CppEditor::Internal::CppEditorPlugin + CppEditor C++ Class Třída C++ @@ -55689,7 +55565,7 @@ Lze používat části jmen, pokud jsou jednoznačné. - CppEditor::QuickFix + CppEditor Move Definition Outside Class Přesunout definice vně třídy @@ -55706,9 +55582,6 @@ Lze používat části jmen, pokud jsou jednoznačné. Insert Virtual Functions of Base Classes Vložit virtuální funkce základních tříd - - - CppEditor::Internal::InsertVirtualMethodsDialog Insert Virtual Functions Vložit virtuální funkce @@ -56700,7 +56573,7 @@ monitor reset - CppEditor::Internal::CppPreProcessorDialog + CppEditor Additional C++ Preprocessor Directives Dodatečné příkazy pro preprocesor @@ -57675,21 +57548,15 @@ Soubory ve zdrojovém adresáři balíčku pro Android jsou zkopírovány do adr - CppEditor::Internal::CppIncludeHierarchyWidget + CppEditor No include hierarchy available Není dostupná žádná hierarchie hlavičkových souborů - - - CppEditor::Internal::CppIncludeHierarchyFactory Include Hierarchy Hierarchie hlavičkových souborů - - - CppEditor::Internal::CppIncludeHierarchyModel Includes Hlavičkové soubory @@ -57719,7 +57586,7 @@ Soubory ve zdrojovém adresáři balíčku pro Android jsou zkopírovány do adr - VirtualFunctionsAssistProcessor + CppEditor ...searching overrides ...Hledají se přepsání diff --git a/share/qtcreator/translations/qtcreator_da.ts b/share/qtcreator/translations/qtcreator_da.ts index f7a3c22c3af..e30df81f0a7 100644 --- a/share/qtcreator/translations/qtcreator_da.ts +++ b/share/qtcreator/translations/qtcreator_da.ts @@ -4600,7 +4600,7 @@ F.eks., vil "Revision: 15" efterlade grenen ved revision 15. - CPlusPlus::CheckSymbols + CppEditor Only virtual functions can be marked 'final' Kun virtuelle funktioner kan mærkes 'final' @@ -4749,7 +4749,7 @@ Men brug af de afslappede og udvidet regler betyder også at der ikke kan levere - ClangDiagnosticConfigsModel + CppEditor Clang-only checks for questionable constructs Clang-kun tjek for tvivlsomme constructs @@ -8629,21 +8629,15 @@ til versionsstyring (%2) - CppEditor::CppIncludeHierarchy + CppEditor No include hierarchy available Intet tilgængeligt inkluderhierarki - - - CppEditor::InsertDeclOperation Add %1 Declaration Tilføj %1 erklæring - - - CppEditor::InsertDefOperation Add Definition in %1 Tilføj definition i %1 @@ -8660,16 +8654,10 @@ til versionsstyring (%2) Add Definition Outside Class Tilføj definition udenfor klasse - - - CppEditor::Internal::CppEditorDocument Note: Multiple parse contexts are available for this file. Choose the preferred one from the editor toolbar. Bemærk: Flere parse-kontekster er tilgængelige for denne fil. Vælg den foretrukne fra redigeringsværktøjslinjen. - - - CppEditor::Internal::CppEditorPlugin C++ SnippetProvider @@ -8755,23 +8743,14 @@ til versionsstyring (%2) Ctrl+Shift+F12 Ctrl+Skift+F12 - - - CppEditor::Internal::CppEditorWidget &Refactor &Genfaktor - - - CppEditor::Internal::CppIncludeHierarchyFactory Include Hierarchy Inkluderhierarki - - - CppEditor::Internal::CppIncludeHierarchyModel Includes Inkluderer @@ -8788,9 +8767,6 @@ til versionsstyring (%2) (cyclic) (cyklisk) - - - CppEditor::Internal::CppOutlineTreeView Expand All Udfold alle @@ -8799,9 +8775,6 @@ til versionsstyring (%2) Collapse All Sammenfold alle - - - CppEditor::Internal::CppPreProcessorDialog Additional C++ Preprocessor Directives Yderligere C++ præprocessor-direktiver @@ -8810,16 +8783,10 @@ til versionsstyring (%2) Additional C++ Preprocessor Directives for %1: Yderligere C++ præprocessor-direktiver for %1: - - - CppEditor::Internal::CppTypeHierarchyFactory Type Hierarchy Typehierarki - - - CppEditor::Internal::CppTypeHierarchyWidget No type hierarchy available Intet tilgængeligt typehierarki @@ -8832,9 +8799,6 @@ til versionsstyring (%2) Derived Afledt - - - CppEditor::Internal::FunctionDeclDefLink Target file was changed, could not apply changes Mål-fil blev ændret, kunne ikke anvende ændringer @@ -8851,9 +8815,6 @@ til versionsstyring (%2) Apply Function Signature Changes Anvend funktion-signatur ændringer - - - CppEditor::Internal::InsertVirtualMethodsDialog Insert Virtual Functions Indsæt virtuelle funktioner @@ -8902,9 +8863,6 @@ til versionsstyring (%2) Clear Added "override" Equivalents Ryd tilføjet "tilsidesæt"-tilsvarender - - - CppEditor::Internal::MinimizableInfoBars File is not part of any project. Filen er ikke en del af noget projekt. @@ -8925,23 +8883,14 @@ til versionsstyring (%2) <b>Warning</b>: The code model could not parse an included file, which might lead to incorrect code completion and highlighting, for example. <b>Advarsel</b>: Kodemodellen kunne ikke parse en inkluderet fil, hvilket f.eks. kan lede til ukorrekt kodefuldførsel og -fremhævning. - - - CppEditor::Internal::ParseContextModel <p><b>Active Parse Context</b>:<br/>%1</p><p>Multiple parse contexts (set of defines, include paths, and so on) are available for this file.</p><p>Choose a parse context to set it as the preferred one. Clear the preference from the context menu.</p> <p><b>Aktive parse-kontekst</b>:<br/>%1</p><p>Flere parse-kontekster (sæt af defines, inkluder-sti osv.) er tilgængelige for denne fil.</p><p>Vælg en parse-kontekst for at sætte den som den foretrukne . Ryd præferencen fra genvejsmenuen.</p> - - - CppEditor::Internal::ParseContextWidget Clear Preferred Parse Context Ryd foretrukne parse-kontekst - - - CppEditor::QuickFix Insert Virtual Functions of Base Classes Indsæt virtuelle funktioner af grundklasser @@ -8966,16 +8915,10 @@ til versionsstyring (%2) Move Definition to Class Flyt definition til klasse - - - CppIndexer C++ Indexer: Skipping file "%1" because it is too big. C++-indekser: Spring over filen "%1" fordi den er for stor. - - - CppSourceProcessor %1: No such file or directory %1: ingen sådan fil eller mappe @@ -9115,7 +9058,7 @@ til versionsstyring (%2) - CppTools::CppEditorOutline + CppTools Sort Alphabetically Sortér alfabetisk @@ -33077,7 +33020,7 @@ For flere detaljer, se /etc/sysctl.d/10-ptrace.conf - QuickFix::ExtractFunction + CppEditor Extract Function Udtræk funktion @@ -40801,7 +40744,7 @@ skal være et repository krævet SSH-autentifikation (se dokumentation på SSH o - VirtualFunctionsAssistProcessor + CppEditor ...searching overrides ...søger blandt tilsidesætninger @@ -42510,7 +42453,7 @@ Kopiér stien til kildefilerne til udklipsholderen? - CppEditor::CppQuickFixFactory + CppEditor Create Getter and Setter Member Functions Opret henter- og sætter-medlemsfunktioner diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 2b559725b72..e9c68523ad0 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -16103,7 +16103,7 @@ Möchten Sie sie überschreiben? - CppEditor::Internal::CppTypeHierarchyWidget + CppEditor No type hierarchy available Keine Klassenhierarchie verfügbar @@ -16124,9 +16124,6 @@ Möchten Sie sie überschreiben? Evaluating type hierarchy... Werte Typ-Hierarchie aus... - - - CppEditor::Internal::CppTypeHierarchyFactory Type Hierarchy Klassenhierarchie @@ -16373,7 +16370,7 @@ Möchten Sie sie überschreiben? - CppEditor::InsertDefOperation + CppEditor Add Definition in %1 Definition in %1 hinzufügen @@ -16390,9 +16387,6 @@ Möchten Sie sie überschreiben? Add Definition Outside Class Definition außerhalb der Klasse erstellen - - - CppEditor::InsertDeclOperation Add %1 Declaration Deklaration für %1 hinzufügen @@ -16761,7 +16755,7 @@ konnte nicht unter Versionsverwaltung (%2) gestellt werden - CppEditor::Internal::CppOutlineTreeView + CppEditor Expand All Alle aufklappen @@ -25054,7 +25048,7 @@ the manifest file by overriding your settings. Allow override? - QuickFix::ExtractFunction + CppEditor Extract Function Funktion herausziehen @@ -25688,7 +25682,7 @@ wirklich löschen? - CppEditor::Internal::FunctionDeclDefLink + CppEditor Target file was changed, could not apply changes Die Änderungen konnten nicht vorgenommen werden, da die Zieldatei geändert wurde @@ -26615,7 +26609,7 @@ wirklich löschen? - CPlusPlus::CheckSymbols + CppEditor Only virtual functions can be marked 'final' Nur virtuelle Funktionen können als 'final' gekennzeichnet werden @@ -28435,7 +28429,7 @@ The affected files are: - CppEditor::QuickFix + CppEditor Rewrite Using %1 Unter Verwendung von %1 umschreiben @@ -28596,9 +28590,6 @@ The affected files are: Insert Virtual Functions of Base Classes Virtuelle Funktionen der Basisklasse einfügen - - - CppEditor::Internal::CppEditorPlugin Shift+F2 Shift+F2 @@ -28751,9 +28742,6 @@ The affected files are: Clangd Clangd - - - CppEditor::Internal::InsertVirtualMethodsDialog Insert Virtual Functions Virtuelle Funktionen einfügen @@ -29956,14 +29944,11 @@ benötigt wird, was meist die Geschwindigkeit erhöht. - CppEditor::Internal::CppIncludeHierarchyFactory + CppEditor Include Hierarchy Include-Hierarchie - - - CppEditor::Internal::CppIncludeHierarchyModel Includes Include-Dateien @@ -29980,9 +29965,6 @@ benötigt wird, was meist die Geschwindigkeit erhöht. (cyclic) (zyklisch) - - - VirtualFunctionsAssistProcessor collecting overrides ... @@ -30619,7 +30601,7 @@ das beim Drücken unter dem Zeiger oder Berührungspunkt war, unter diesem Punkt - CppEditor::Internal::CppPreProcessorDialog + CppEditor Additional C++ Preprocessor Directives for %1: Zusätzliche Präprozessor-Anweisungen für %1: @@ -31761,7 +31743,7 @@ Möchten Sie es beenden? - CppSourceProcessor + CppEditor %1: No such file or directory %1: Es existiert keine Datei oder kein Verzeichnis dieses Namens @@ -38724,7 +38706,7 @@ Siehe auch die Einstellungen für Google Test. - ClangDiagnosticConfigsModel + CppEditor Checks for questionable constructs Prüft auf fragwürdige Konstrukte @@ -40704,7 +40686,7 @@ Zeile: %4, Spalte: %5 - CppEditor::Internal::CppEditorDocument + CppEditor <b>Warning</b>: This file is not part of any project. The code model might have issues parsing this file properly. <b>Warnung</b>: Diese Datei ist in keinem Projekt enthalten. Das Codemodell könnte Probleme haben, die Datei korrekt auszuwerten. @@ -40713,23 +40695,14 @@ Zeile: %4, Spalte: %5 Note: Multiple parse contexts are available for this file. Choose the preferred one from the editor toolbar. Hinweis: Für diese Datei sind mehrere Auswertungskontexte verfügbar. Wählen Sie den bevorzugten in der Editorwerkzeugleiste aus. - - - CppEditor::Internal::ParseContextModel <p><b>Active Parse Context</b>:<br/>%1</p><p>Multiple parse contexts (set of defines, include paths, and so on) are available for this file.</p><p>Choose a parse context to set it as the preferred one. Clear the preference from the context menu.</p> <p><b>Aktiver Auswertungskontext</b>:<br/>%1</p><p>Für diese Datei sind mehrere Auswertungskontexte (Kombinationen aus Defines, Include-Verzeichnissen usw.) verfügbar.</p><p>Wählen Sie einen bevorzugten Auswertungskontext aus. Sie können diese Einstellung über das Kontextmenü zurücksetzen.</p> - - - CppEditor::Internal::ParseContextWidget Clear Preferred Parse Context Bevorzugten Auswertungskontext aufheben - - - CppIndexer C++ Indexer: Skipping file "%1" because it is too big. C++-Indexer: Überspringe Datei "%1", weil sie zu groß ist. @@ -42272,7 +42245,7 @@ Are you sure? - CppEditor::CppQuickFixFactory + CppEditor Create Getter and Setter Member Functions Getter- und Setter-Funktionen erzeugen @@ -44321,7 +44294,7 @@ You might find further explanations in the Application Output view. - CppEditor::Internal::CppIncludeHierarchyWidget + CppEditor No include hierarchy available Keine Include-Hierarchie verfügbar @@ -51245,7 +51218,7 @@ benötigt wird, was meist die Geschwindigkeit erhöht. - CppEditor::Internal::CppCodeStyleSettingsPage + CppEditor General Allgemein @@ -51471,9 +51444,6 @@ ausgerichtet werden würden Right const/volatile Rechtes const/volatile - - - CppEditor::Internal::CppFileSettingsPage Headers Header-Dateien @@ -53132,7 +53102,7 @@ in "%2" aus. - CppEditor::AbstractEditorSupport + CppEditor The file name. Der Dateiname. @@ -53141,23 +53111,14 @@ in "%2" aus. The class name. Der Klassenname. - - - CppEditor::Internal::BuiltinIndexingSupport Parsing C/C++ Files Werte C/C++-Dateien aus - - - CppEditor::ClangDiagnosticConfigsSelectionWidget Diagnostic configuration: Diagnosekonfiguration: - - - CppEditor::ClangDiagnosticConfigsWidget Diagnostic Configurations Diagnosekonfigurationen @@ -53215,9 +53176,6 @@ in "%2" aus. %1 %1 - - - CppEditor::ConfigsModel Built-in Integriert @@ -53226,9 +53184,6 @@ in "%2" aus. Custom Benutzerdefiniert - - - CppEditor::ClangBaseChecks For appropriate options, consult the GCC or Clang manual pages or the <a href="https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html">GCC online documentation</a>. Für passende Optionen lesen Sie das GCC- oder Clang-Handbuch oder auch die <a href="https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html">GCC-Onlinedokumentation</a>. @@ -53237,9 +53192,6 @@ in "%2" aus. Use diagnostic flags from build system Diagnose-Flags des Build-Systems verwenden - - - CppEditor Follow Symbol to Type is only available when using clangd Symbol unter Einfügemarke zum Typ verfolgen steht nur mit Clangd zur Verfügung @@ -53260,10 +53212,6 @@ in "%2" aus. File Naming Namenskonventionen für Dateien - - Diagnostic Configurations - Diagnosekonfigurationen - C++ Symbols in Current Document C++-Symbole im aktuellen Dokument @@ -53322,9 +53270,6 @@ in "%2" aus. The project contains C++ source files, but the currently active kit has no C++ compiler. The code model will not be fully functional. Das Projekt enthält C++-Quelldateien, aber das aktive Kit hat keinen C++-Compiler. Das Codemodell wird nur eingeschränkt funktionieren. - - - CppEditor::ClangdSettings Background Priority Hintergrund-Priorität @@ -53341,9 +53286,6 @@ in "%2" aus. Off Aus - - - CppEditor::Internal::CppCodeModelSettingsWidget Interpret ambiguous headers as C headers Mehrdeutige Header als C-Header behandeln @@ -53372,17 +53314,10 @@ in "%2" aus. Uncheck this to invoke the actual compiler to show a pre-processed source file in the editor. Wählen Sie dies ab, um den Compiler zum Anzeigen von vorverarbeiteten Dateien zu benutzen. - - General - Allgemein - Code Model Codemodell - - - CppEditor::Internal::ClangdSettingsWidget If background indexing is enabled, global symbol searches will yield more accurate results, at the cost of additional CPU load when @@ -53484,10 +53419,6 @@ die vom selben Clangd-Prozess verwaltet werden sollen, fügen Sie diese hier hin Add ... Hinzufügen... - - Remove - Entfernen - Choose a session: Sitzung wählen: @@ -53504,28 +53435,15 @@ die vom selben Clangd-Prozess verwaltet werden sollen, fügen Sie diese hier hin The clangd version is %1, but %2 or greater is required. Die Clangd-Version ist %1, aber %2 oder neuer wird benötigt. - - Clangd - Clangd - - - - CppEditor::Internal::CppEditorOutline Sort Alphabetically Alphabetisch sortieren - - - CppEditor::CppEditorWidget &Refactor https://de.wikipedia.org/wiki/Refactoring &Refactoring - - - CppEditor::Internal::CppFileSettingsWidget /************************************************************************** ** %1 license header template @@ -53550,9 +53468,6 @@ die vom selben Clangd-Prozess verwaltet werden sollen, fügen Sie diese hier hin Choose Location for New License Template File Dateiname für eine neue Lizenzvorlage - - - CppEditor::Internal::CppFindReferences Reads Lesezugriffe @@ -53594,16 +53509,10 @@ die vom selben Clangd-Prozess verwaltet werden sollen, fügen Sie diese hier hin C++ Macro Usages: C++ Macro-Referenzen: - - - CppEditor::Internal::CppIncludesFilter Matches all files that are included by all C++ files in all projects. Append "+<number>" or ":<number>" to jump to the given line number. Append another "+<number>" or ":<number>" to jump to the column number as well. Filtert alle Dateien die von allen C++-Dateien aller Projekte eingebunden werden. Fügen Sie "+<Zahl>" oder ":<Zahl>" an, um zur angegebenen Zeile zu springen. Fügen Sie noch einmal "+<Zahl>" oder ":<Zahl>" an, um auch zur angegebenen Spalte zu springen. - - - CppEditor::OverviewModel <Select Symbol> <Symbol auswählen> @@ -53612,16 +53521,10 @@ die vom selben Clangd-Prozess verwaltet werden sollen, fügen Sie diese hier hin <No Symbols> <Keine Symbole> - - - CppEditor::CppProjectUpdater Preparing C++ Code Model Bereite das C++-Codemodell vor - - - CppEditor::Quickfix Add Class Member "%1" Klassen-Member "%1" hinzufügen @@ -53714,7 +53617,7 @@ die vom selben Clangd-Prozess verwaltet werden sollen, fügen Sie diese hier hin - CppEditor::Internal::ConstructorParams + CppEditor Initialize in Constructor Im Konstruktor initialisieren @@ -53758,7 +53661,7 @@ Use drag and drop to change the order of the parameters. - CppEditor::Internal::CppQuickFixProjectsSettings + CppEditor Quick Fix settings are saved in a file. Existing settings file "%1" found. Should this file be used or a new one be created? Einstellungen für Quick Fixes werden in einer Datei gespeichert. Es wurde eine existierende Einstellungs-Datei "%1" gefunden. Soll diese Datei benutzt, oder eine neue Datei erstellt werden? @@ -53775,9 +53678,6 @@ Use drag and drop to change the order of the parameters. Create New Neue erstellen - - - CppEditor::Internal::CppQuickFixProjectSettingsWidget Custom settings are saved in a file. If you use the global settings, you can delete that file. Benutzerdefinierte Einstellungen werden in einer Datei gespeichert. Wenn Sie die globalen Einstellungen benutzen, können Sie diese Datei löschen. @@ -53794,9 +53694,6 @@ Use drag and drop to change the order of the parameters. Reset to Global Auf globale Einstellungen zurücksetzen - - - CppEditor::CppToolsSettings Global Settings @@ -53835,7 +53732,7 @@ Use drag and drop to change the order of the parameters. - CppEditor::Internal::SymbolsFindFilter + CppEditor Searching for Symbol Suche nach Symbol @@ -53856,10 +53753,6 @@ Use drag and drop to change the order of the parameters. Enums Enumerationen - - Declarations - Deklarationen - Scope: %1 Types: %2 @@ -53876,29 +53769,10 @@ Flags: %3 Projects Projekte - - - CppEditor::Internal::SymbolsFindFilterConfigWidget Types: Typen: - - Classes - Klassen - - - Functions - Funktionen - - - Enums - Enumerationen - - - Declarations - Deklarationen - Projects only Nur Projekte diff --git a/share/qtcreator/translations/qtcreator_es.ts b/share/qtcreator/translations/qtcreator_es.ts index a8d449f2911..c2b0b1246fa 100644 --- a/share/qtcreator/translations/qtcreator_es.ts +++ b/share/qtcreator/translations/qtcreator_es.ts @@ -2127,7 +2127,7 @@ Would you like to overwrite them? - CppEditor::Internal::CPPEditor + CppEditor Sort alphabetically Ordenar alfabeticamente @@ -2148,9 +2148,6 @@ Would you like to overwrite them? Reformat Document Reformatear documento - - - CppEditor::Internal::ClassNamePage Enter class name Introduzca nombre de clase @@ -2163,30 +2160,18 @@ Would you like to overwrite them? Configure... Configurar... - - - CppEditor::Internal::CppClassWizard Error while generating file contents. Error generando el contenido del archivo. - - - CppEditor::Internal::CppClassWizardDialog C++ Class Wizard Asistente de Clases C++ - - - CppEditor::Internal::CppHoverHandler Unfiltered Sin filtro - - - CppEditor::Internal::CppPlugin C++ diff --git a/share/qtcreator/translations/qtcreator_fr.ts b/share/qtcreator/translations/qtcreator_fr.ts index 08c56f44681..c33f916fe9b 100644 --- a/share/qtcreator/translations/qtcreator_fr.ts +++ b/share/qtcreator/translations/qtcreator_fr.ts @@ -2866,15 +2866,11 @@ Voulez vous les écraser ? - CppEditor::Internal::CPPEditor + CppEditor Sort alphabetically Trier par ordre alphabétique - - Sort Alphabetically - Trier par ordre alphabétique - This change cannot be undone. Ce changement ne peut être annulé. @@ -2883,17 +2879,10 @@ Voulez vous les écraser ? Yes, I know what I am doing. Simplifier les déclarations. - - Unused variable - Variable non utilisée - Simplify Declarations Simplifier les déclarations - - - CppEditor::Internal::ClassNamePage Enter class name Entrer le nom de la classe @@ -2910,16 +2899,10 @@ Voulez vous les écraser ? Configure... Configurer... - - - CppEditor::Internal::CppClassWizard Error while generating file contents. Erreur a la génération du contenu du fichier. - - - CppEditor::Internal::CppClassWizardDialog C++ Class Wizard Assistant de création de classe C++ @@ -2928,40 +2911,18 @@ Voulez vous les écraser ? Details Détails - - - CppEditor::Internal::CppHoverHandler Unfiltered Sans filtre - - - CppEditor::Internal::CppPlugin - - C++ - C++ - Creates a C++ header file. Créer un fichier header C++. - - C++ Header File - Fichier header C++ - Creates a C++ source file. Créer un fichier source C++. - - C++ Source File - Fichier source C++ - - - C++ Class - Classe C++ - Creates a header and a source file for a new class. Créer un header et un fichier source pour une nouvelle classe. @@ -2974,62 +2935,10 @@ Voulez vous les écraser ? Switch between Method Declaration/Definition Changer entre la définition et déclaration de la méthode - - Creates a C++ header and a source file for a new class that you can add to a C++ project. - Crée les fichier d'en-tête et fichier source C++ pour une nouvelle classe que vous pouvez ajouter a votre projet C++. - - - Creates a C++ source file that you can add to a C++ project. - Crée un fichier source C++ que vous pouvez ajouter a votre projet C++. - - - Creates a C++ header file that you can add to a C++ project. - Crée un fichier d'en-tête C++ que vous pouvez ajouter a votre projet C++. - Follow Symbol Under Cursor Suivre le symbole sous le curseur - - Switch Between Method Declaration/Definition - Changer entre la définition et déclaration de la méthode - - - Shift+F2 - Shift+F2 - - - Find Usages - Trouver les utilisations - - - Ctrl+Shift+U - Ctrl+Shift+U - - - Open Type Hierarchy - Ouvrir la hiérarchie de type - - - Ctrl+Shift+T - Ctrl+Maj+T - - - Meta+Shift+T - Meta+Shift+T - - - Rename Symbol Under Cursor - Renommer le symbole sous le curseur - - - CTRL+SHIFT+R - Ctrl+Shift+R - - - Update Code Model - Mettre à jour le modèle de code - Rename Symbol under Cursor Renommer le symbole sous le curseur @@ -28820,14 +28729,11 @@ La liste du serveur était %2. - CppEditor::InsertDeclOperation + CppEditor Add %1 Declaration Ajouter la déclaration %1 - - - CppEditor::InsertDefOperation Add Definition in %1 Ajouter la définition dans %1 @@ -28844,9 +28750,6 @@ La liste du serveur était %2. Add Definition Outside Class Ajouter une définition en dehors de la classe - - - CppEditor::Internal::CppTypeHierarchyWidget No type hierarchy available Aucune hiérarchie de type disponible @@ -28859,9 +28762,6 @@ La liste du serveur était %2. Derived Dérivé - - - CppEditor::Internal::CppTypeHierarchyFactory Type Hierarchy Hiérarchie de type @@ -34028,19 +33928,11 @@ au gestionnaire de version (%2) - CppEditor::Internal::CPPEditorWidget + CppEditor Sort Alphabetically Trier par ordre alphabétique - - This change cannot be undone. - Ce changement ne peut être annulé. - - - Yes, I know what I am doing. - Simplifier les déclarations. - &Refactor &Refactoriser @@ -34049,9 +33941,6 @@ au gestionnaire de version (%2) Unused variable Variable non utilisée - - - CppEditor::Internal::InsertQtPropertyMembers Generate missing Q_PROPERTY members... Générer les membre Q_PROPERTY manquant... @@ -34060,9 +33949,6 @@ au gestionnaire de version (%2) Generate Missing Q_PROPERTY Members... Générer les membre Q_PROPERTY manquants... - - - CppEditor::Internal::CppOutlineTreeView Expand All Développer tout @@ -34072,13 +33958,6 @@ au gestionnaire de version (%2) Réduire tout - - CppEditor::Internal::CppSnippetProvider - - C++ - C++ - - Debugger @@ -44820,7 +44699,7 @@ si un dépôt requiert une authentification SSH (voir la documentation sur SSH e - QuickFix::ExtractFunction + CppEditor Extract Function Extraire la fonction @@ -47738,7 +47617,7 @@ Oui :) - CppEditor::Internal::FunctionDeclDefLink + CppEditor Target file was changed, could not apply changes Le fichier cible a été modifié, impossible d'appliquer les changements @@ -47785,7 +47664,7 @@ Oui :) - CPlusPlus::CheckSymbols + CppEditor Only virtual methods can be marked 'final' Seules les méthodes virtuelles peuvent être marqués "final" @@ -52484,7 +52363,7 @@ Les noms partiels peuvent êtres utilisé s'ils ne sont pas ambigües. - CppEditor::Internal::CppEditorPlugin + CppEditor C++ Class Classe C++ @@ -52602,7 +52481,7 @@ Les noms partiels peuvent êtres utilisé s'ils ne sont pas ambigües. - CppEditor::QuickFix + CppEditor Move Definition Outside Class Déplacer la définition en dehors de la classe @@ -52619,9 +52498,6 @@ Les noms partiels peuvent êtres utilisé s'ils ne sont pas ambigües.Insert Virtual Functions of Base Classes Insérer les fonctions virtuelles des classes de bases - - - CppEditor::Internal::InsertVirtualMethodsDialog Insert Virtual Functions Insérer les fonctions virtuelles @@ -54818,7 +54694,7 @@ réinitialisation du moniteur - CppEditor::Internal::CppPreProcessorDialog + CppEditor Additional C++ Preprocessor Directives Directives supplémentaires pour le préprocesseur C++ @@ -55733,21 +55609,15 @@ réinitialisation du moniteur - CppEditor::Internal::CppIncludeHierarchyWidget + CppEditor No include hierarchy available Aucune hiérarchie d'inclusion est disponible - - - CppEditor::Internal::CppIncludeHierarchyFactory Include Hierarchy Hiérarchie d'inclusion - - - CppEditor::Internal::CppIncludeHierarchyModel Includes Inclusions @@ -55777,7 +55647,7 @@ réinitialisation du moniteur - VirtualFunctionsAssistProcessor + CppEditor ...searching overrides ... recherche des surcharges diff --git a/share/qtcreator/translations/qtcreator_hr.ts b/share/qtcreator/translations/qtcreator_hr.ts index 4ff65b24e28..853444fdaa8 100644 --- a/share/qtcreator/translations/qtcreator_hr.ts +++ b/share/qtcreator/translations/qtcreator_hr.ts @@ -3027,7 +3027,7 @@ p, li { white-space: pre-wrap; } - CppEditor::Internal::CppPreProcessorDialog + CppEditor Additional C++ Preprocessor Directives Dodatne C++ predprocesorske direktive @@ -20233,14 +20233,11 @@ u kontrolu verzija (%2) - CppEditor::Internal::CppEditorDocument + CppEditor Note: Multiple parse contexts are available for this file. Choose the preferred one from the editor toolbar. - - - CppEditor::Internal::CppEditorPlugin C++ SnippetProvider @@ -20333,16 +20330,10 @@ u kontrolu verzija (%2) Ctrl+Shift+F12 Ctrl+Shift+F12 - - - CppEditor::Internal::CppEditorWidget &Refactor - - - CppEditor::Internal::FunctionDeclDefLink Target file was changed, could not apply changes @@ -20359,9 +20350,6 @@ u kontrolu verzija (%2) Apply Function Signature Changes - - - CppEditor::Internal::CppIncludeHierarchyModel (none) (bez) @@ -20378,9 +20366,6 @@ u kontrolu verzija (%2) Included by Uključeno od - - - CppEditor::Internal::CppIncludeHierarchyWidget No include hierarchy available @@ -20389,16 +20374,10 @@ u kontrolu verzija (%2) Synchronize with Editor Sinkroniziraj s uređivačem - - - CppEditor::Internal::CppIncludeHierarchyFactory Include Hierarchy Uključi hijerarhiju - - - CppEditor::QuickFix Insert Virtual Functions of Base Classes Umetni virtualnu funkciju osnovnih klasa @@ -20423,9 +20402,6 @@ u kontrolu verzija (%2) Move Definition to Class Premjesti definiciju u klasu - - - CppEditor::Internal::InsertVirtualMethodsDialog Insert Virtual Functions Umetni virtualnu funkciju @@ -20474,9 +20450,6 @@ u kontrolu verzija (%2) Clear Added "override" Equivalents - - - CppEditor::Internal::MinimizableInfoBars File is not part of any project. Datoteka nije dio bilo kojeg projekta. @@ -20497,9 +20470,6 @@ u kontrolu verzija (%2) <b>Warning</b>: The code model could not parse an included file, which might lead to incorrect code completion and highlighting, for example. - - - CppEditor::Internal::CppOutlineTreeView Expand All Rasklopi sve @@ -20508,16 +20478,10 @@ u kontrolu verzija (%2) Collapse All Sklopi sve - - - CppEditor::Internal::ParseContextModel <p><b>Active Parse Context</b>:<br/>%1</p><p>Multiple parse contexts (set of defines, include paths, and so on) are available for this file.</p><p>Choose a parse context to set it as the preferred one. Clear the preference from the context menu.</p> - - - CppEditor::Internal::ParseContextWidget Clear Preferred Parse Context @@ -20651,14 +20615,11 @@ u kontrolu verzija (%2) - CppEditor::InsertDeclOperation + CppEditor Add %1 Declaration - - - CppEditor::InsertDefOperation Add Definition in %1 @@ -20675,9 +20636,6 @@ u kontrolu verzija (%2) Add Definition Outside Class - - - CppEditor::CppQuickFixFactory Create Getter and Setter Member Functions @@ -20702,9 +20660,6 @@ u kontrolu verzija (%2) Generate Missing Q_PROPERTY Members - - - QuickFix::ExtractFunction Extract Function @@ -20721,9 +20676,6 @@ u kontrolu verzija (%2) Access Pristup - - - CppEditor::Internal::CppTypeHierarchyWidget No type hierarchy available @@ -20736,9 +20688,6 @@ u kontrolu verzija (%2) Derived - - - CppEditor::Internal::CppTypeHierarchyFactory Type Hierarchy @@ -20763,7 +20712,7 @@ u kontrolu verzija (%2) - ClangDiagnosticConfigsModel + CppEditor Clang-only checks for questionable constructs @@ -20861,7 +20810,7 @@ u kontrolu verzija (%2) - CPlusPlus::CheckSymbols + CppEditor Only virtual functions can be marked 'final' @@ -20930,7 +20879,7 @@ u kontrolu verzija (%2) - CppTools::CppEditorOutline + CppTools Sort Alphabetically @@ -20998,7 +20947,7 @@ u kontrolu verzija (%2) - CppSourceProcessor + CppEditor %1: No such file or directory @@ -21044,7 +20993,7 @@ u kontrolu verzija (%2) - CppIndexer + CppEditor C++ Indexer: Skipping file "%1" because it is too big. @@ -21071,7 +21020,7 @@ u kontrolu verzija (%2) - VirtualFunctionsAssistProcessor + CppEditor ...searching overrides diff --git a/share/qtcreator/translations/qtcreator_hu.ts b/share/qtcreator/translations/qtcreator_hu.ts index 6ee12b8647c..597a4f4a293 100644 --- a/share/qtcreator/translations/qtcreator_hu.ts +++ b/share/qtcreator/translations/qtcreator_hu.ts @@ -3210,7 +3210,7 @@ p { - CppEditor::Internal::0 + CppEditor Sort alphabetically Rendezés betűrendbe @@ -3287,9 +3287,6 @@ p { Switch between Method Declaration/Definition Deklaráció/definíció közötti váltás. - - - CppEditor::Internal::CPPEditor Sort alphabetically Rendezés betűrendbe @@ -3302,9 +3299,6 @@ p { Yes, I know what I am doing. Igen, tudom, hogy mit csinálok. - - - CppEditor::Internal::ClassNamePage Enter class name Osztály nevének bevitele @@ -3317,30 +3311,18 @@ p { Configure... Konfigurálás... - - - CppEditor::Internal::CppClassWizard Error while generating file contents. Hiba történt a fájl tartalmak legenerálása közben. - - - CppEditor::Internal::CppClassWizardDialog C++ Class Wizard C++ osztály varázsló - - - CppEditor::Internal::CppHoverHandler Unfiltered Szűrés nélküli - - - CppEditor::Internal::CppPlugin C++ C++ diff --git a/share/qtcreator/translations/qtcreator_it.ts b/share/qtcreator/translations/qtcreator_it.ts index 88cfe0fe328..ee6d8e3c583 100644 --- a/share/qtcreator/translations/qtcreator_it.ts +++ b/share/qtcreator/translations/qtcreator_it.ts @@ -2146,7 +2146,7 @@ Vuoi sovrascriverli? - CppEditor::Internal::CPPEditor + CppEditor Sort alphabetically Ordine alfabetico @@ -2159,9 +2159,6 @@ Vuoi sovrascriverli? Yes, I know what I am doing. - - - CppEditor::Internal::ClassNamePage Enter class name Inserisci il nome della classe @@ -2174,30 +2171,18 @@ Vuoi sovrascriverli? Configure... Configura... - - - CppEditor::Internal::CppClassWizard Error while generating file contents. Errore durante la generazione del contenuto dei file. - - - CppEditor::Internal::CppClassWizardDialog C++ Class Wizard Assistente alla creazione Classe C++ - - - CppEditor::Internal::CppHoverHandler Unfiltered Non filtrato - - - CppEditor::Internal::CppPlugin C++ C++ diff --git a/share/qtcreator/translations/qtcreator_ja.ts b/share/qtcreator/translations/qtcreator_ja.ts index a57e43e6695..99451191c66 100644 --- a/share/qtcreator/translations/qtcreator_ja.ts +++ b/share/qtcreator/translations/qtcreator_ja.ts @@ -1913,7 +1913,7 @@ p, li { white-space: pre-wrap; } - CppEditor::Internal::CppPreProcessorDialog + CppEditor Additional C++ Preprocessor Directives 追加C++プリプロセッサディレクティブ @@ -14672,7 +14672,7 @@ to version control (%2) - CppEditor::Internal::CppEditorPlugin + CppEditor C++ SnippetProvider @@ -14773,9 +14773,6 @@ to version control (%2) Ctrl+Shift+F12 Ctrl+Shift+F12 - - - CppEditor::Internal::FunctionDeclDefLink Target file was changed, could not apply changes ターゲットファイルが変更された為、変更内容を適用できません @@ -14792,23 +14789,14 @@ to version control (%2) Apply Function Signature Changes 関数シグネチャの変更を適用します - - - CppEditor::CppIncludeHierarchy No include hierarchy available インクルード階層は利用できません - - - CppEditor::Internal::CppIncludeHierarchyFactory Include Hierarchy 階層を含める - - - CppEditor::Internal::CppIncludeHierarchyModel Includes インクルード @@ -14825,9 +14813,6 @@ to version control (%2) (cyclic) (循環) - - - CppEditor::Internal::CppOutlineTreeView Expand All すべて展開 @@ -14981,14 +14966,11 @@ to version control (%2) - CppEditor::InsertDeclOperation + CppEditor Add %1 Declaration %1 の宣言を追加 - - - CppEditor::InsertDefOperation Add Definition in %1 %1 に定義を追加 @@ -15034,7 +15016,7 @@ to version control (%2) - QuickFix::ExtractFunction + CppEditor Extract Function 関数の抽出 @@ -15051,9 +15033,6 @@ to version control (%2) Access アクセス - - - CppEditor::QuickFix Move Definition Outside Class 定義をクラスの外へ移動する @@ -15078,9 +15057,6 @@ to version control (%2) Insert Virtual Functions of Base Classes 基底クラスの仮想関数を追加する - - - CppEditor::Internal::InsertVirtualMethodsDialog Insert Virtual Functions 仮想関数の追加 @@ -15129,16 +15105,10 @@ to version control (%2) Filter フィルタ - - - CppEditor::Internal::CppSnippetProvider C++ C++ - - - CppEditor::Internal::CppTypeHierarchyWidget No type hierarchy available 型階層は利用できません @@ -15159,16 +15129,10 @@ to version control (%2) Evaluating type hierarchy... 型階層を評価する... - - - CppEditor::Internal::CppTypeHierarchyFactory Type Hierarchy 型階層 - - - VirtualFunctionsAssistProcessor ...searching overrides ...オーバーライドの検索中 @@ -15189,7 +15153,7 @@ to version control (%2) - CPlusPlus::CheckSymbols + CppEditor Only virtual functions can be marked 'final' 仮想関数のみが 'final' としてマークすることができます @@ -34985,7 +34949,7 @@ API バージョンが %1 以上の SDK をインストールしてください - CppSourceProcessor + CppEditor %1: No such file or directory %1: そのようなファイルもしくはディレクトリはありません @@ -39194,7 +39158,7 @@ Do you want to check them out now? - CppEditor::Internal::CppEditorWidget + CppEditor &Refactor リファクタリング(&R) @@ -39212,7 +39176,7 @@ Do you want to check them out now? - ClangDiagnosticConfigsModel + CppEditor Warnings for questionable constructs 問題の原因と思われる記述への警告 @@ -39231,7 +39195,7 @@ Do you want to check them out now? - CppTools::CppEditorOutline + CppTools Sort Alphabetically アルファベット順にソート @@ -45433,7 +45397,7 @@ Output: - CppEditor::Internal::CppQuickFixSettingsWidget + CppEditor Form フォーム @@ -48231,25 +48195,15 @@ Continue? - CppEditor::Internal::CppIncludeHierarchyWidget - - No include hierarchy available - インクルード階層は利用できません - + CppEditor Synchronize with Editor エディタと同期 - - - CppEditor::Internal::MinimizableInfoBars Minimize 最小化 - - - CppEditor::CppQuickFixFactory Create Getter and Setter Member Functions ゲッター及びセッターメンバ関数を作成する @@ -48279,7 +48233,7 @@ Continue? - CppEditor::Internal::ConstructorParams + CppEditor Initialize in Constructor コンストラクタでの初期化 diff --git a/share/qtcreator/translations/qtcreator_pl.ts b/share/qtcreator/translations/qtcreator_pl.ts index fbf2d98a81c..99b49bba5c8 100644 --- a/share/qtcreator/translations/qtcreator_pl.ts +++ b/share/qtcreator/translations/qtcreator_pl.ts @@ -13034,7 +13034,7 @@ Lista serwera: %2. - CppEditor::Internal::CppTypeHierarchyWidget + CppEditor No type hierarchy available Brak dostępnej hierarchii typów @@ -13047,9 +13047,6 @@ Lista serwera: %2. Derived Klasy pochodne - - - CppEditor::Internal::CppTypeHierarchyFactory Type Hierarchy Hierarchia typów @@ -13865,14 +13862,11 @@ Adds the library and include paths to the .pro file. - CppEditor::InsertDeclOperation + CppEditor Add %1 Declaration Dodaj deklarację %1 - - - CppEditor::InsertDefOperation Add Definition in %1 Dodaj definicję w %1 @@ -15045,7 +15039,7 @@ do systemu kontroli wersji (%2) - CppEditor::Internal::CppOutlineTreeView + CppEditor Expand All Rozwiń wszystko @@ -21191,7 +21185,7 @@ Wersje Qt można dodać w: Opcje > Budowanie i uruchamianie > Wersje Qt. - CppEditor::Internal::FunctionDeclDefLink + CppEditor Target file was changed, could not apply changes Plik docelowy uległ zmianie, nie można zastosować zmian @@ -21208,9 +21202,6 @@ Wersje Qt można dodać w: Opcje > Budowanie i uruchamianie > Wersje Qt.Apply Function Signature Changes Zastosuj zmiany w sygnaturze funkcji - - - QuickFix::ExtractFunction Extract Function @@ -24804,7 +24795,7 @@ Więcej informacji w dokumentacji "Checking Code Syntax". - CppEditor::Internal::CppEditorPlugin + CppEditor Shift+F2 Shift+F2 @@ -24890,9 +24881,6 @@ Więcej informacji w dokumentacji "Checking Code Syntax".Ctrl+Shift+F12 Ctrl+Shift+F12 - - - CppEditor::QuickFix Move Definition Outside Class Przenieś definicję na zewnątrz klasy @@ -24917,9 +24905,6 @@ Więcej informacji w dokumentacji "Checking Code Syntax".Insert Virtual Functions of Base Classes Wstaw wirtualne metody klas bazowych - - - CppEditor::Internal::InsertVirtualMethodsDialog Insert Virtual Functions Wstaw wirtualne metody @@ -24984,7 +24969,7 @@ Więcej informacji w dokumentacji "Checking Code Syntax". - CPlusPlus::CheckSymbols + CppEditor Only virtual functions can be marked 'final' Jedynie funkcje wirtualne mogą być opatrzone "final" @@ -26318,7 +26303,7 @@ Zdalny: %4 - CppEditor::Internal::CppPreProcessorDialog + CppEditor Additional C++ Preprocessor Directives Dodatkowe dyrektywy preprocesora C++ @@ -27077,14 +27062,11 @@ Czy odinstalować istniejący pakiet? - CppEditor::Internal::CppIncludeHierarchyFactory + CppEditor Include Hierarchy Hierarchia dołączeń - - - CppEditor::Internal::CppIncludeHierarchyModel Includes Dołączenia @@ -27101,9 +27083,6 @@ Czy odinstalować istniejący pakiet? (cyclic) (cykl) - - - VirtualFunctionsAssistProcessor ...searching overrides ...wyszukiwanie nadpisań @@ -30448,14 +30427,11 @@ Do you want to check them out now? - CppEditor::Internal::CppEditorWidget + CppEditor &Refactor &Refaktoryzacja - - - CppSourceProcessor %1: No such file or directory %1: Brak pliku lub katalogu @@ -33758,7 +33734,7 @@ Pliki z katalogu źródłowego pakietu Android są kopiowane do katalogu budowan - CppTools::CppEditorOutline + CppTools Sort Alphabetically Posortuj alfabetycznie @@ -37332,7 +37308,7 @@ Ustaw prawdziwy plik wykonywalny Clang. - ClangDiagnosticConfigsModel + CppEditor Warnings for questionable constructs Ostrzeżenia o niejasnych konstrukcjach @@ -38448,7 +38424,7 @@ Komunikat: - CppEditor::CppIncludeHierarchy + CppEditor No include hierarchy available Brak dostępnej hierarchii dołączeń @@ -39408,7 +39384,7 @@ Uwaga: podczas używania zwykłego formatu tekstowego może brakować niektóryc - CppIndexer + CppEditor C++ Indexer: Skipping file "%1" because it is too big. Indekser C++: plik "%1" posiada zbyt duży rozmiar, zostanie on pominięty. @@ -41229,14 +41205,11 @@ Błąd: %2 - CppEditor::Internal::CppEditorDocument + CppEditor Note: Multiple parse contexts are available for this file. Choose the preferred one from the editor toolbar. - - - CppEditor::Internal::MinimizableInfoBars File is not part of any project. Plik nie jest częścią żadnego projektu. @@ -41257,16 +41230,10 @@ Błąd: %2 <b>Warning</b>: The code model could not parse an included file, which might lead to slow or incorrect code completion and highlighting, for example. <b>Ostrzeżenie</b>: Model kodu nie mógł przeparsować dołączonego pliku, może to spowodować powolne lub niepoprawne działanie uzupełniania bądź podświetlania kodu. - - - CppEditor::Internal::ParseContextModel <p><b>Active Parse Context</b>:<br/>%1</p><p>Multiple parse contexts (set of defines, include paths, and so on) are available for this file.</p><p>Choose a parse context to set it as the preferred one. Clear the preference from the context menu.</p> - - - CppEditor::Internal::ParseContextWidget Clear Preferred Parse Context diff --git a/share/qtcreator/translations/qtcreator_ru.ts b/share/qtcreator/translations/qtcreator_ru.ts index 8cf77522647..b02da5e10f4 100644 --- a/share/qtcreator/translations/qtcreator_ru.ts +++ b/share/qtcreator/translations/qtcreator_ru.ts @@ -6197,7 +6197,7 @@ For example, "Revision: 15" will leave the branch at revision 15. - CPlusPlus::CheckSymbols + CppEditor Only virtual functions can be marked 'final' Только виртуальные функции могут иметь атрибут «final» @@ -6538,7 +6538,7 @@ However, using the relaxed and extended rules means also that no highlighting/co - ClangDiagnosticConfigsModel + CppEditor Checks for questionable constructs Проверки на сомнительные конструкции @@ -11639,7 +11639,7 @@ to version control (%2) - CppEditor::CppQuickFixFactory + CppEditor Create Getter and Setter Member Functions Создать методы получения и установки значения @@ -11664,16 +11664,10 @@ to version control (%2) Generate Missing Q_PROPERTY Members Создание отсутствующих членов Q_PROPERTY - - - CppEditor::InsertDeclOperation Add %1 Declaration Добавление объявления %1 - - - CppEditor::InsertDefOperation Add Definition in %1 Добавить реализацию в %1 @@ -11690,16 +11684,10 @@ to version control (%2) Add Definition Outside Class Добавить реализацию вне класса - - - CppEditor::Internal::CppEditorDocument Note: Multiple parse contexts are available for this file. Choose the preferred one from the editor toolbar. Несколько контекстов разбора доступно для этого файла. Выберите предпочтительный в панели инструментов редактора. - - - CppEditor::Internal::CppEditorPlugin Shift+F2 Shift+F2 @@ -11784,23 +11772,14 @@ to version control (%2) Ctrl+Shift+F12 Ctrl+Shift+F12 - - - CppEditor::Internal::CppEditorWidget &Refactor &Рефакторинг - - - CppEditor::Internal::CppIncludeHierarchyFactory Include Hierarchy Иерархия включений - - - CppEditor::Internal::CppIncludeHierarchyModel Includes Включения @@ -11817,9 +11796,6 @@ to version control (%2) (cyclic) (циклически) - - - CppEditor::Internal::CppIncludeHierarchyWidget No include hierarchy available Нет доступных иерархий включений @@ -11828,9 +11804,6 @@ to version control (%2) Synchronize with Editor Согласовывать с редактором - - - CppEditor::Internal::CppOutlineTreeView Expand All Развернуть всё @@ -11839,9 +11812,6 @@ to version control (%2) Collapse All Свернуть всё - - - CppEditor::Internal::CppPreProcessorDialog Additional C++ Preprocessor Directives Дополнительные директивы препроцессора C++ @@ -11850,16 +11820,10 @@ to version control (%2) Additional C++ Preprocessor Directives for %1: Дополнительные директивы препроцессора C++ для %1: - - - CppEditor::Internal::CppTypeHierarchyFactory Type Hierarchy Иерархия типов - - - CppEditor::Internal::CppTypeHierarchyWidget No type hierarchy available Иерархия типов недоступна @@ -11872,9 +11836,6 @@ to version control (%2) Derived Производные - - - CppEditor::Internal::FunctionDeclDefLink Target file was changed, could not apply changes Невозможно применить изменения, так как целевой файл изменился @@ -11891,9 +11852,6 @@ to version control (%2) Apply Function Signature Changes Применить изменения сигнатуры функции - - - CppEditor::Internal::InsertVirtualMethodsDialog Insert Virtual Functions Вставка виртуальных методов @@ -11942,9 +11900,6 @@ to version control (%2) Clear Added "override" Equivalents Удаление аналогов «override» - - - CppEditor::Internal::MinimizableInfoBars File is not part of any project. Файл не является частью проекта. @@ -11965,23 +11920,14 @@ to version control (%2) <b>Warning</b>: The code model could not parse an included file, which might lead to incorrect code completion and highlighting, for example. <b>Внимание!</b> Модель кода не сможет обрабатывать включённый файл, который, например, может приводить к неверному дополнению кода и подсветки. - - - CppEditor::Internal::ParseContextModel <p><b>Active Parse Context</b>:<br/>%1</p><p>Multiple parse contexts (set of defines, include paths, and so on) are available for this file.</p><p>Choose a parse context to set it as the preferred one. Clear the preference from the context menu.</p> <p><b>Активный контекст разбора</b>:<br/>%1</p><p>Для этого файла доступно несколько контекстов разбора (набор определений, путей включения и пр.).</p><p>Выберите контекст разбора и задайте его предпочтительным. Убрать предпочтение можно через контекстное меню.</p> - - - CppEditor::Internal::ParseContextWidget Clear Preferred Parse Context Убрать предпочтительный контекст разбора - - - CppEditor::QuickFix Move Definition Outside Class Вынести реализацию из класса @@ -12006,16 +11952,10 @@ to version control (%2) Insert Virtual Functions of Base Classes Вставить виртуальные методы базовых классов - - - CppIndexer C++ Indexer: Skipping file "%1" because it is too big. Индексатор C++: Пропускается файл «%1», так как слишком большой. - - - CppSourceProcessor %1: No such file or directory %1: Нет такого файла или каталога @@ -12180,7 +12120,7 @@ to version control (%2) - CppTools::CppEditorOutline + CppTools Sort Alphabetically Сортировать по алфавиту @@ -42543,7 +42483,7 @@ For more details, see /etc/sysctl.d/10-ptrace.conf - QuickFix::ExtractFunction + CppEditor Extract Function Извлечь функцию @@ -51099,7 +51039,7 @@ What do you want to do? - VirtualFunctionsAssistProcessor + CppEditor ...searching overrides ... поиск переопределений diff --git a/share/qtcreator/translations/qtcreator_sl.ts b/share/qtcreator/translations/qtcreator_sl.ts index 7e0d280feef..0c08273f7a2 100644 --- a/share/qtcreator/translations/qtcreator_sl.ts +++ b/share/qtcreator/translations/qtcreator_sl.ts @@ -1682,7 +1682,7 @@ Ali jih želite nadomestiti? - CppEditor::Internal::ClassNamePage + CppEditor Enter Class Name Vnesite ime razreda @@ -1695,16 +1695,10 @@ Ali jih želite nadomestiti? Configure... Nastavi … - - - CppEditor::Internal::CppClassWizard Error while generating file contents. Napaka med ustvarjanjem vsebine datotek. - - - CppEditor::Internal::CppClassWizardDialog C++ Class Wizard Čarovnik razreda C++ @@ -1713,9 +1707,6 @@ Ali jih želite nadomestiti? Details Podrobnosti - - - CppEditor::Internal::CppPlugin C++ Header File Datoteka z glavo C++ @@ -22930,7 +22921,7 @@ Vedite: to lahko odstrani krajevno datoteko. - CppEditor::Internal::CPPEditorWidget + CppEditor Sort Alphabetically Razvrsti po abecedi @@ -22943,30 +22934,18 @@ Vedite: to lahko odstrani krajevno datoteko. Unused variable Neuporabljena spremenljivka - - - CppEditor::InsertDeclOperation Add %1 Declaration Dodaj deklaracijo za %1 - - - CppEditor::InsertDefOperation Add Definition in %1 Dodaj definicijo v %1 - - - CppEditor::Internal::InsertQtPropertyMembers Generate missing Q_PROPERTY members... Ustvari manjkajoče člane Q_PROPERTY ... - - - CppEditor::Internal::CppOutlineTreeView Expand All Razširi vse @@ -22975,23 +22954,10 @@ Vedite: to lahko odstrani krajevno datoteko. Collapse All Skrči vse - - - CppEditor::Internal::CppSnippetProvider - - C++ - C++ - - - - CppEditor::Internal::CppTypeHierarchyWidget No type hierarchy available Hierarhija tipov ni na voljo - - - CppEditor::Internal::CppTypeHierarchyFactory Type Hierarchy Hierarhija tipov @@ -29808,11 +29774,7 @@ Preverite pravice za dostop do mape. - CppEditor::Internal::CPPEditor - - Sort Alphabetically - Razvrsti po abecedi - + CppEditor This change cannot be undone. Te spremembe ni moč razveljaviti. @@ -29821,10 +29783,6 @@ Preverite pravice za dostop do mape. Yes, I know what I am doing. Da, vem kaj počnem. - - Unused variable - Neuporabljena spremenljivka - CppTools::Internal::FunctionArgumentWidget diff --git a/share/qtcreator/translations/qtcreator_uk.ts b/share/qtcreator/translations/qtcreator_uk.ts index 52f6f4e26c8..b4d673b9f24 100644 --- a/share/qtcreator/translations/qtcreator_uk.ts +++ b/share/qtcreator/translations/qtcreator_uk.ts @@ -3649,20 +3649,10 @@ to version control (%2) CppEditor - - C++ - C++ - - - - CppEditor::InsertDeclOperation Add %1 Declaration Додати оголошення %1 - - - CppEditor::InsertDefOperation Add Definition in %1 Додати визначення %1 @@ -3679,24 +3669,14 @@ to version control (%2) Add Definition Outside Class Додати визначення поза класом - - - CppEditor::Internal::CPPEditorWidget Sort Alphabetically Сортувати за абеткою - - &Refactor - &Рефакторинг - Unused variable Невикористана змінна - - - CppEditor::Internal::ClassNamePage Enter Class Name Введіть назву класу @@ -3709,27 +3689,14 @@ to version control (%2) Details Деталі - - - CppEditor::Internal::CppClassWizard Error while generating file contents. Помилка під час генерування змісту файлу. - - - CppEditor::Internal::CppClassWizardDialog C++ Class Wizard Майстер класу C++ - - Details - Деталі - - - - CppEditor::Internal::CppOutlineTreeView Expand All Розгорнути все @@ -3738,23 +3705,14 @@ to version control (%2) Collapse All Згорнути все - - - CppEditor::Internal::CppSnippetProvider C++ C++ - - - CppEditor::Internal::CppTypeHierarchyFactory Type Hierarchy Ієрархія типів - - - CppEditor::Internal::CppTypeHierarchyWidget No type hierarchy available Ієрархія типів не доступна @@ -26278,7 +26236,7 @@ should a repository require SSH-authentication (see documentation on SSH and the - QuickFix::ExtractFunction + CppEditor Extract Function Виділити функцію @@ -29482,7 +29440,7 @@ To add the Qt versions, select Options > Build & Run > Qt Versions. - CppEditor::Internal::FunctionDeclDefLink + CppEditor Target file was changed, could not apply changes Не вдалось застосувати зміни, оскільки цільовий файл було змінено @@ -29512,7 +29470,7 @@ To add the Qt versions, select Options > Build & Run > Qt Versions. - CPlusPlus::CheckSymbols + CppEditor Only virtual methods can be marked 'final' Лише віртуальні методи можуть бути позначені як 'final' @@ -35145,7 +35103,7 @@ Partial names can be used if they are unambiguous. - CppEditor::Internal::CppEditorPlugin + CppEditor C++ Class Клас C++ @@ -35262,9 +35220,6 @@ Partial names can be used if they are unambiguous. Update Code Model Оновити модель коду - - - CppEditor::QuickFix Move Definition Outside Class Перенести визначення поза клас @@ -35289,9 +35244,6 @@ Partial names can be used if they are unambiguous. Insert Virtual Functions of Base Classes Вставка віртуальних функцій базових класів - - - CppEditor::Internal::InsertVirtualMethodsDialog Insert Virtual Functions Вставка віртуальних функцій @@ -36358,7 +36310,7 @@ monitor reset - CppEditor::Internal::CppPreProcessorDialog + CppEditor Additional C++ Preprocessor Directives Додаткові директиви препроцесора C++ @@ -37417,21 +37369,15 @@ Do you want to uninstall the existing package next time? - CppEditor::Internal::CppIncludeHierarchyWidget + CppEditor No include hierarchy available Ієрархія заголовків не доступна - - - CppEditor::Internal::CppIncludeHierarchyFactory Include Hierarchy Ієрархія заголовків - - - CppEditor::Internal::CppIncludeHierarchyModel Includes Включає @@ -37448,9 +37394,6 @@ Do you want to uninstall the existing package next time? (cyclic) (циклічно) - - - VirtualFunctionsAssistProcessor ...searching overrides ...пошук замін @@ -41102,14 +41045,7 @@ Install an SDK of at least API version %1. - CppEditor::Internal::CppEditorOutline - - Sort Alphabetically - Сортувати за абеткою - - - - CppSourceProcessor + CppEditor %1: No such file or directory %1: Файл чи тека не існують @@ -43305,7 +43241,7 @@ The statements may not contain '{' nor '}' characters. - CppEditor::Internal::CppEditorWidget + CppEditor &Refactor &Рефакторинг @@ -46006,7 +45942,7 @@ Affected are breakpoints %1 - CppTools::CppEditorOutline + CppTools Sort Alphabetically Сортувати за абеткою @@ -50198,7 +50134,7 @@ Please set a real Clang executable. - ClangDiagnosticConfigsModel + CppEditor Warnings for questionable constructs Попередження про сумнівні конструкції diff --git a/share/qtcreator/translations/qtcreator_zh_CN.ts b/share/qtcreator/translations/qtcreator_zh_CN.ts index 66eb38cb672..0bd4743bd2f 100644 --- a/share/qtcreator/translations/qtcreator_zh_CN.ts +++ b/share/qtcreator/translations/qtcreator_zh_CN.ts @@ -6481,7 +6481,7 @@ Make sure that CMAKE_BUILD_TYPE variable matches the "Build type" fiel - CPlusPlus::CheckSymbols + CppEditor Only virtual functions can be marked 'final' @@ -7009,7 +7009,7 @@ However, using the relaxed and extended rules means also that no highlighting/co - ClangDiagnosticConfigsModel + CppEditor Default Clang-Tidy and Clazy checks @@ -12342,9 +12342,6 @@ to version control (%2) The project contains C++ source files, but the currently active kit has no C++ compiler. The code model will not be fully functional. - - - CppEditor::AbstractEditorSupport The file name. @@ -12353,9 +12350,6 @@ to version control (%2) The class name. - - - CppEditor::ClangBaseChecks For appropriate options, consult the GCC or Clang manual pages or the <a href="https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html">GCC online documentation</a>. @@ -12364,20 +12358,10 @@ to version control (%2) Use diagnostic flags from build system - - - CppEditor::ClangDiagnosticConfigsSelectionWidget Diagnostic configuration: - - - CppEditor::ClangDiagnosticConfigsWidget - - Diagnostic Configurations - - Copy... 复制... @@ -12430,9 +12414,6 @@ to version control (%2) %1 %1 - - - CppEditor::ClangdSettings Background Priority @@ -12449,9 +12430,6 @@ to version control (%2) Off - - - CppEditor::ConfigsModel Built-in @@ -12460,23 +12438,14 @@ to version control (%2) Custom - - - CppEditor::CppEditorWidget &Refactor 重构(&R) - - - CppEditor::CppProjectUpdater Preparing C++ Code Model - - - CppEditor::CppQuickFixFactory Create Implementations for Member Functions @@ -12529,9 +12498,6 @@ to version control (%2) Generate Constructor - - - CppEditor::CppToolsSettings Global Settings @@ -12549,16 +12515,10 @@ to version control (%2) Old Creator 旧的 Creator - - - CppEditor::InsertDeclOperation Add %1 Declaration 添加%1声明 - - - CppEditor::InsertDefOperation Add Definition in %1 在%1添加定义 @@ -12575,16 +12535,10 @@ to version control (%2) Add Definition Outside Class - - - CppEditor::Internal::BuiltinIndexingSupport Parsing C/C++ Files - - - CppEditor::Internal::ClangdSettingsWidget If background indexing is enabled, global symbol searches will yield more accurate results, at the cost of additional CPU load when @@ -12672,10 +12626,6 @@ managed by the same clangd process, add them here. Add ... - - Remove - 删除 - Choose a session: @@ -12696,9 +12646,6 @@ managed by the same clangd process, add them here. Clangd - - - CppEditor::Internal::ConstructorParams Initialize in Constructor @@ -12715,9 +12662,6 @@ managed by the same clangd process, add them here. Default Value - - - CppEditor::Internal::CppCodeModelSettingsWidget Interpret ambiguous headers as C headers @@ -12754,13 +12698,6 @@ managed by the same clangd process, add them here. Code Model - - - CppEditor::Internal::CppCodeStyleSettingsPage - - General - 概要 - Content 内容 @@ -12973,9 +12910,6 @@ if they would align to the next line Right const/volatile - - - CppEditor::Internal::CppEditorDocument <b>Warning</b>: This file is not part of any project. The code model might have issues parsing this file properly. @@ -12984,16 +12918,10 @@ if they would align to the next line Note: Multiple parse contexts are available for this file. Choose the preferred one from the editor toolbar. - - - CppEditor::Internal::CppEditorOutline Sort Alphabetically 按字母排序 - - - CppEditor::Internal::CppEditorPlugin &C++ C++(&C) @@ -13142,13 +13070,6 @@ if they would align to the next line Ctrl+Shift+F12 Ctrl+Shift+F12 - - Clangd - - - - - CppEditor::Internal::CppFileSettingsPage Headers 头文件 @@ -13229,9 +13150,6 @@ These prefixes are used in addition to current file name on Switch Header/Source License &template: - - - CppEditor::Internal::CppFileSettingsWidget /************************************************************************** ** %1 license header template @@ -13250,9 +13168,6 @@ These prefixes are used in addition to current file name on Switch Header/Source Choose Location for New License Template File 为新的版权许可模板文件选择一个存储位置 - - - CppEditor::Internal::CppFindReferences Reads @@ -13292,16 +13207,10 @@ These prefixes are used in addition to current file name on Switch Header/Source C++ Macro Usages: C++ 宏的使用: - - - CppEditor::Internal::CppIncludeHierarchyFactory Include Hierarchy - - - CppEditor::Internal::CppIncludeHierarchyModel (none) @@ -13318,9 +13227,6 @@ These prefixes are used in addition to current file name on Switch Header/Source Included by - - - CppEditor::Internal::CppIncludeHierarchyWidget No include hierarchy available @@ -13329,16 +13235,10 @@ These prefixes are used in addition to current file name on Switch Header/Source Synchronize with Editor 与编辑器同步 - - - CppEditor::Internal::CppIncludesFilter Matches all files that are included by all C++ files in all projects. Append "+<number>" or ":<number>" to jump to the given line number. Append another "+<number>" or ":<number>" to jump to the column number as well. - - - CppEditor::Internal::CppOutlineTreeView Expand All 展开全部 @@ -13347,9 +13247,6 @@ These prefixes are used in addition to current file name on Switch Header/Source Collapse All 折叠全部 - - - CppEditor::Internal::CppPreProcessorDialog Additional C++ Preprocessor Directives @@ -13358,9 +13255,6 @@ These prefixes are used in addition to current file name on Switch Header/Source Additional C++ Preprocessor Directives for %1: - - - CppEditor::Internal::CppQuickFixProjectSettingsWidget Custom settings are saved in a file. If you use the global settings, you can delete that file. @@ -13377,9 +13271,6 @@ These prefixes are used in addition to current file name on Switch Header/Source Reset to Global - - - CppEditor::Internal::CppQuickFixProjectsSettings Quick Fix settings are saved in a file. Existing settings file "%1" found. Should this file be used or a new one be created? @@ -13396,16 +13287,10 @@ These prefixes are used in addition to current file name on Switch Header/Source Create New - - - CppEditor::Internal::CppTypeHierarchyFactory Type Hierarchy 类型层次 - - - CppEditor::Internal::CppTypeHierarchyWidget No type hierarchy available 没有可用的类型层次 @@ -13426,9 +13311,6 @@ These prefixes are used in addition to current file name on Switch Header/Source Evaluating type hierarchy... - - - CppEditor::Internal::FunctionDeclDefLink Target file was changed, could not apply changes 目标文件改变, 无法应用修改 @@ -13445,9 +13327,6 @@ These prefixes are used in addition to current file name on Switch Header/Source Apply Function Signature Changes 应用函数签名的更改 - - - CppEditor::Internal::InsertVirtualMethodsDialog Insert Virtual Functions @@ -13496,23 +13375,14 @@ These prefixes are used in addition to current file name on Switch Header/Source Clear Added "override" Equivalents - - - CppEditor::Internal::ParseContextModel <p><b>Active Parse Context</b>:<br/>%1</p><p>Multiple parse contexts (set of defines, include paths, and so on) are available for this file.</p><p>Choose a parse context to set it as the preferred one. Clear the preference from the context menu.</p> - - - CppEditor::Internal::ParseContextWidget Clear Preferred Parse Context - - - CppEditor::Internal::SymbolsFindFilter Searching for Symbol @@ -13533,10 +13403,6 @@ These prefixes are used in addition to current file name on Switch Header/Source Enums 枚举 - - Declarations - 声明 - Scope: %1 Types: %2 @@ -13553,29 +13419,10 @@ Flags: %3 Projects 项目 - - - CppEditor::Internal::SymbolsFindFilterConfigWidget Types: 类型: - - Classes - - - - Functions - - - - Enums - 枚举 - - - Declarations - 声明 - Projects only 仅显示项目 @@ -13584,9 +13431,6 @@ Flags: %3 All files 所有文件 - - - CppEditor::OverviewModel <Select Symbol> @@ -13595,9 +13439,6 @@ Flags: %3 <No Symbols> <没有符号> - - - CppEditor::QuickFix Insert Virtual Functions of Base Classes @@ -13758,9 +13599,6 @@ Flags: %3 Remove "using namespace %1" and Adjust Type Names Accordingly - - - CppEditor::Quickfix Add Class Member "%1" @@ -13773,9 +13611,6 @@ Flags: %3 Data type: - - - CppIndexer C++ Indexer: Skipping file "%1" because it is too big. @@ -13976,7 +13811,7 @@ e.g. name = "m_test_foo_": - CppSourceProcessor + CppEditor %1: No such file or directory %1: 没有文件或者目录 @@ -41764,7 +41599,7 @@ For more details, see /etc/sysctl.d/10-ptrace.conf - QuickFix::ExtractFunction + CppEditor Extract Function 解压缩函数 @@ -51018,7 +50853,7 @@ What do you want to do? - VirtualFunctionsAssistProcessor + CppEditor collecting overrides ... diff --git a/share/qtcreator/translations/qtcreator_zh_TW.ts b/share/qtcreator/translations/qtcreator_zh_TW.ts index 0b3293284b6..a35d30d3a34 100644 --- a/share/qtcreator/translations/qtcreator_zh_TW.ts +++ b/share/qtcreator/translations/qtcreator_zh_TW.ts @@ -1746,7 +1746,7 @@ - CppEditor::Internal::ClassNamePage + CppEditor Enter Class Name 輸入類別名稱 @@ -1755,16 +1755,10 @@ The header and source file names will be derived from the class name 標頭檔和源碼檔名將取自類別名稱 - - - CppEditor::Internal::CppClassWizard Error while generating file contents. 產生檔案內容時發生錯誤。 - - - CppEditor::Internal::CppClassWizardDialog C++ Class Wizard C++ 類別精靈 @@ -1773,9 +1767,6 @@ Details 詳情 - - - CppEditor::Internal::CppPlugin C++ Header File C++ 標頭檔 @@ -16001,21 +15992,15 @@ Server list was %2. - CppEditor::InsertDeclOperation + CppEditor Add %1 Declaration 新增 %1 宣告 - - - CppEditor::InsertDefOperation Add Definition in %1 在 %1 新增定義 - - - CppEditor::Internal::CppTypeHierarchyWidget No type hierarchy available 沒有可用的型態階層 @@ -16028,9 +16013,6 @@ Server list was %2. Derived 衍生 - - - CppEditor::Internal::CppTypeHierarchyFactory Type Hierarchy 型態階層 @@ -19354,7 +19336,7 @@ to version control (%2) - CppEditor::Internal::CPPEditorWidget + CppEditor Sort Alphabetically 按字母排序 @@ -19367,9 +19349,6 @@ to version control (%2) Unused variable 未使用的變數 - - - CppEditor::Internal::InsertQtPropertyMembers Generate missing Q_PROPERTY members... 產生遺失的 Q_PROPERTY 成員... @@ -19378,9 +19357,6 @@ to version control (%2) Generate Missing Q_PROPERTY Members... - - - CppEditor::Internal::CppOutlineTreeView Expand All 全部展開 @@ -19390,13 +19366,6 @@ to version control (%2) 全部摺疊 - - CppEditor::Internal::CppSnippetProvider - - C++ - C++ - - Debugger @@ -28204,7 +28173,7 @@ should a repository require SSH-authentication (see documentation on SSH and the - QuickFix::ExtractFunction + CppEditor Extract Function 展開函式 @@ -30813,7 +30782,7 @@ Please choose a valid package name for your application (e.g. "org.example. - CppEditor::Internal::FunctionDeclDefLink + CppEditor Target file was changed, could not apply changes 目標檔案改變,無法套用變更 diff --git a/src/plugins/cppeditor/abstracteditorsupport.cpp b/src/plugins/cppeditor/abstracteditorsupport.cpp index f421f756718..a47fb412f32 100644 --- a/src/plugins/cppeditor/abstracteditorsupport.cpp +++ b/src/plugins/cppeditor/abstracteditorsupport.cpp @@ -4,6 +4,7 @@ #include "abstracteditorsupport.h" #include "cppeditorplugin.h" +#include "cppeditortr.h" #include "cppfilesettingspage.h" #include "cppmodelmanager.h" @@ -42,9 +43,9 @@ QString AbstractEditorSupport::licenseTemplate(const FilePath &filePath, const Q { const QString license = Internal::CppFileSettings::licenseTemplate(); Utils::MacroExpander expander; - expander.registerVariable("Cpp:License:FileName", tr("The file name."), + expander.registerVariable("Cpp:License:FileName", Tr::tr("The file name."), [filePath] { return filePath.fileName(); }); - expander.registerVariable("Cpp:License:ClassName", tr("The class name."), + expander.registerVariable("Cpp:License:ClassName", Tr::tr("The class name."), [className] { return className; }); return Utils::TemplateEngine::processText(&expander, license, nullptr); diff --git a/src/plugins/cppeditor/baseeditordocumentprocessor.h b/src/plugins/cppeditor/baseeditordocumentprocessor.h index 4e21e39c1b3..afb74f46e64 100644 --- a/src/plugins/cppeditor/baseeditordocumentprocessor.h +++ b/src/plugins/cppeditor/baseeditordocumentprocessor.h @@ -28,7 +28,8 @@ namespace TextEditor { class TextDocument; } namespace CppEditor { // For clang code model only, move? -struct CPPEDITOR_EXPORT ToolTipInfo { +struct CPPEDITOR_EXPORT ToolTipInfo +{ QString text; QString briefComment; diff --git a/src/plugins/cppeditor/clangdiagnosticconfigsselectionwidget.cpp b/src/plugins/cppeditor/clangdiagnosticconfigsselectionwidget.cpp index 5477186e24b..3a3ceacad4e 100644 --- a/src/plugins/cppeditor/clangdiagnosticconfigsselectionwidget.cpp +++ b/src/plugins/cppeditor/clangdiagnosticconfigsselectionwidget.cpp @@ -5,6 +5,7 @@ #include "clangdiagnosticconfigswidget.h" #include "cppcodemodelsettings.h" +#include "cppeditortr.h" #include "cpptoolsreuse.h" #include @@ -55,7 +56,7 @@ ClangDiagnosticConfigs ClangDiagnosticConfigsSelectionWidget::customConfigs() co QString ClangDiagnosticConfigsSelectionWidget::label() const { - return tr("Diagnostic configuration:"); + return Tr::tr("Diagnostic configuration:"); } void ClangDiagnosticConfigsSelectionWidget::setUpUi(bool withLabel) @@ -80,7 +81,7 @@ void ClangDiagnosticConfigsSelectionWidget::onButtonClicked() widget->layout()->setContentsMargins(0, 0, 0, 0); QDialog dialog; - dialog.setWindowTitle(ClangDiagnosticConfigsWidget::tr("Diagnostic Configurations")); + dialog.setWindowTitle(Tr::tr("Diagnostic Configurations")); dialog.setLayout(new QVBoxLayout); dialog.layout()->addWidget(widget); auto *buttonsBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); diff --git a/src/plugins/cppeditor/clangdiagnosticconfigswidget.cpp b/src/plugins/cppeditor/clangdiagnosticconfigswidget.cpp index 70398e765e6..6ef459f1b69 100644 --- a/src/plugins/cppeditor/clangdiagnosticconfigswidget.cpp +++ b/src/plugins/cppeditor/clangdiagnosticconfigswidget.cpp @@ -4,6 +4,7 @@ #include "clangdiagnosticconfigswidget.h" #include "clangdiagnosticconfigsmodel.h" +#include "cppeditortr.h" #include "wrappablelineedit.h" #include @@ -65,13 +66,11 @@ public: class ConfigsModel : public TreeModel { - Q_OBJECT - public: ConfigsModel(const ClangDiagnosticConfigs &configs) { - m_builtinRoot = new GroupNode(tr("Built-in")); - m_customRoot = new GroupNode(tr("Custom")); + m_builtinRoot = new GroupNode(Tr::tr("Built-in")); + m_customRoot = new GroupNode(Tr::tr("Custom")); rootItem()->appendChild(m_builtinRoot); rootItem()->appendChild(m_customRoot); @@ -118,17 +117,15 @@ private: class ClangBaseChecksWidget : public QWidget { - Q_DECLARE_TR_FUNCTIONS(CppEditor::ClangBaseChecks) - public: ClangBaseChecksWidget() { - auto label = new QLabel(tr("For appropriate options, consult the GCC or Clang manual " - "pages or the " - "GCC online documentation.")); + auto label = new QLabel(Tr::tr("For appropriate options, consult the GCC or Clang manual " + "pages or the %1 GCC online documentation.") + .arg("")); label->setOpenExternalLinks(true); - useFlagsFromBuildSystemCheckBox = new QCheckBox(tr("Use diagnostic flags from build system")); + useFlagsFromBuildSystemCheckBox = new QCheckBox(Tr::tr("Use diagnostic flags from build system")); diagnosticOptionsTextEdit = new WrappableLineEdit; @@ -151,9 +148,9 @@ ClangDiagnosticConfigsWidget::ClangDiagnosticConfigsWidget(const ClangDiagnostic : QWidget(parent) , m_configsModel(new ConfigsModel(configs)) { - auto copyButton = new QPushButton(tr("Copy...")); - m_renameButton = new QPushButton(tr("Rename...")); - m_removeButton = new QPushButton(tr("Remove")); + auto copyButton = new QPushButton(Tr::tr("Copy...")); + m_renameButton = new QPushButton(Tr::tr("Rename...")); + m_removeButton = new QPushButton(Tr::tr("Remove")); m_infoLabel = new InfoLabel; @@ -169,7 +166,7 @@ ClangDiagnosticConfigsWidget::ClangDiagnosticConfigsWidget(const ClangDiagnostic m_clangBaseChecks = new ClangBaseChecksWidget; m_tabWidget = new QTabWidget; - m_tabWidget->addTab(m_clangBaseChecks, tr("Clang Warnings")); + m_tabWidget->addTab(m_clangBaseChecks, Tr::tr("Clang Warnings")); using namespace Layouting; @@ -206,10 +203,10 @@ void ClangDiagnosticConfigsWidget::onCopyButtonClicked() const ClangDiagnosticConfig &config = currentConfig(); bool dialogAccepted = false; const QString newName = QInputDialog::getText(this, - tr("Copy Diagnostic Configuration"), - tr("Diagnostic configuration name:"), + Tr::tr("Copy Diagnostic Configuration"), + Tr::tr("Diagnostic configuration name:"), QLineEdit::Normal, - tr("%1 (Copy)").arg(config.displayName()), + Tr::tr("%1 (Copy)").arg(config.displayName()), &dialogAccepted); if (dialogAccepted) { const ClangDiagnosticConfig customConfig @@ -229,8 +226,8 @@ void ClangDiagnosticConfigsWidget::onRenameButtonClicked() bool dialogAccepted = false; const QString newName = QInputDialog::getText(this, - tr("Rename Diagnostic Configuration"), - tr("New name:"), + Tr::tr("Rename Diagnostic Configuration"), + Tr::tr("New name:"), QLineEdit::Normal, config.displayName(), &dialogAccepted); @@ -280,7 +277,7 @@ static QString validateDiagnosticOptions(const QStringList &options) for (const QString &option : options) { if (!isValidOption(option)) - return ClangDiagnosticConfigsWidget::tr("Option \"%1\" is invalid.").arg(option); + return Tr::tr("Option \"%1\" is invalid.").arg(option); } return QString(); @@ -343,7 +340,7 @@ void ClangDiagnosticConfigsWidget::sync() if (config.isReadOnly()) { m_infoLabel->setType(InfoLabel::Information); - m_infoLabel->setText(tr("Copy this configuration to customize it.")); + m_infoLabel->setText(Tr::tr("Copy this configuration to customize it.")); m_infoLabel->setFilled(false); } @@ -369,11 +366,11 @@ void ClangDiagnosticConfigsWidget::updateValidityWidgets(const QString &errorMes { if (errorMessage.isEmpty()) { m_infoLabel->setType(InfoLabel::Information); - m_infoLabel->setText(tr("Configuration passes sanity checks.")); + m_infoLabel->setText(Tr::tr("Configuration passes sanity checks.")); m_infoLabel->setFilled(false); } else { m_infoLabel->setType(InfoLabel::Error); - m_infoLabel->setText(tr("%1").arg(errorMessage)); + m_infoLabel->setText(Tr::tr("%1").arg(errorMessage)); m_infoLabel->setFilled(true); } } @@ -411,6 +408,4 @@ QTabWidget *ClangDiagnosticConfigsWidget::tabWidget() const return m_tabWidget; } -} // CppEditor namespace - -#include "clangdiagnosticconfigswidget.moc" +} // CppEditor diff --git a/src/plugins/cppeditor/cppchecksymbols.cpp b/src/plugins/cppeditor/cppchecksymbols.cpp index aab8f539c86..7728ea308c1 100644 --- a/src/plugins/cppeditor/cppchecksymbols.cpp +++ b/src/plugins/cppeditor/cppchecksymbols.cpp @@ -5,10 +5,11 @@ #include "cpplocalsymbols.h" +#include "cppeditortr.h" + #include #include -#include #include // This is for experimeting highlighting ctors/dtors as functions (instead of types). @@ -503,11 +504,9 @@ bool CheckSymbols::visit(SimpleDeclarationAST *ast) // Add a diagnostic message if non-virtual function has override/final marker if ((_usages.back().kind != SemanticHighlighter::VirtualFunctionDeclarationUse)) { if (funTy->isOverride()) - warning(declrIdNameAST, QCoreApplication::translate( - "CPlusplus::CheckSymbols", "Only virtual functions can be marked 'override'")); + warning(declrIdNameAST, Tr::tr("Only virtual functions can be marked 'override'")); else if (funTy->isFinal()) - warning(declrIdNameAST, QCoreApplication::translate( - "CPlusPlus::CheckSymbols", "Only virtual functions can be marked 'final'")); + warning(declrIdNameAST, Tr::tr("Only virtual functions can be marked 'final'")); } } } @@ -776,8 +775,7 @@ void CheckSymbols::checkNamespace(NameAST *name) const unsigned length = tokenAt(name->lastToken() - 1).utf16charsEnd() - tokenAt(name->firstToken()).utf16charsBegin(); - warning(line, column, QCoreApplication::translate("CPlusPlus::CheckSymbols", - "Expected a namespace-name"), length); + warning(line, column, Tr::tr( "Expected a namespace-name"), length); } bool CheckSymbols::hasVirtualDestructor(Class *klass) const @@ -1398,9 +1396,9 @@ bool CheckSymbols::maybeAddFunction(const QList &candidates, NameAST // Add a diagnostic message if argument count does not match if (matchType == Match_TooFewArgs) - warning(line, column, QCoreApplication::translate("CplusPlus::CheckSymbols", "Too few arguments"), length); + warning(line, column, Tr::tr("Too few arguments"), length); else if (matchType == Match_TooManyArgs) - warning(line, column, QCoreApplication::translate("CPlusPlus::CheckSymbols", "Too many arguments"), length); + warning(line, column, Tr::tr("Too many arguments"), length); const Result use(line, column, length, kind); addUse(use); diff --git a/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp b/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp index 79092b2983d..8b9cba0d630 100644 --- a/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp +++ b/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp @@ -5,8 +5,9 @@ #include "baseeditordocumentprocessor.h" #include "cppcodemodelinspectordumper.h" -#include "cppeditorwidget.h" #include "cppeditordocument.h" +#include "cppeditorwidget.h" +#include "cppeditortr.h" #include "cppmodelmanager.h" #include "cpptoolsreuse.h" #include "cppworkingcopy.h" @@ -1433,7 +1434,7 @@ CppCodeModelInspectorDialog::CppCodeModelInspectorDialog(QWidget *parent) Row { m_partGeneralView, Column { - tr("Compiler Flags"), + Tr::tr("Compiler Flags"), m_partGeneralCompilerFlagsEdit, }, } diff --git a/src/plugins/cppeditor/cppcodemodelsettings.cpp b/src/plugins/cppeditor/cppcodemodelsettings.cpp index 878ac9ca0a8..1e5ad709b6c 100644 --- a/src/plugins/cppeditor/cppcodemodelsettings.cpp +++ b/src/plugins/cppeditor/cppcodemodelsettings.cpp @@ -5,6 +5,7 @@ #include "clangdiagnosticconfigsmodel.h" #include "cppeditorconstants.h" +#include "cppeditortr.h" #include "cpptoolsreuse.h" #include @@ -218,10 +219,10 @@ QString ClangdSettings::priorityToString(const IndexingPriority &priority) QString ClangdSettings::priorityToDisplayString(const IndexingPriority &priority) { switch (priority) { - case IndexingPriority::Background: return tr("Background Priority"); - case IndexingPriority::Normal: return tr("Normal Priority"); - case IndexingPriority::Low: return tr("Low Priority"); - case IndexingPriority::Off: return tr("Off"); + case IndexingPriority::Background: return Tr::tr("Background Priority"); + case IndexingPriority::Normal: return Tr::tr("Normal Priority"); + case IndexingPriority::Low: return Tr::tr("Low Priority"); + case IndexingPriority::Off: return Tr::tr("Off"); } return {}; } diff --git a/src/plugins/cppeditor/cppcodemodelsettingspage.cpp b/src/plugins/cppeditor/cppcodemodelsettingspage.cpp index 2b3a33b63af..61db55a5cda 100644 --- a/src/plugins/cppeditor/cppcodemodelsettingspage.cpp +++ b/src/plugins/cppeditor/cppcodemodelsettingspage.cpp @@ -6,6 +6,7 @@ #include "clangdiagnosticconfigsselectionwidget.h" #include "clangdiagnosticconfigswidget.h" #include "cppeditorconstants.h" +#include "cppeditortr.h" #include "cpptoolsreuse.h" #include @@ -39,8 +40,6 @@ namespace CppEditor::Internal { class CppCodeModelSettingsWidget final : public Core::IOptionsPageWidget { - Q_DECLARE_TR_FUNCTIONS(CppEditor::Internal::CppCodeModelSettingsWidget) - public: CppCodeModelSettingsWidget(CppCodeModelSettings *s); @@ -63,18 +62,18 @@ CppCodeModelSettingsWidget::CppCodeModelSettingsWidget(CppCodeModelSettings *s) : m_settings(s) { m_interpretAmbiguousHeadersAsCHeaders - = new QCheckBox(tr("Interpret ambiguous headers as C headers")); + = new QCheckBox(Tr::tr("Interpret ambiguous headers as C headers")); - m_skipIndexingBigFilesCheckBox = new QCheckBox(tr("Do not index files greater than")); + m_skipIndexingBigFilesCheckBox = new QCheckBox(Tr::tr("Do not index files greater than")); m_skipIndexingBigFilesCheckBox->setChecked(m_settings->skipIndexingBigFiles()); m_bigFilesLimitSpinBox = new QSpinBox; - m_bigFilesLimitSpinBox->setSuffix(tr("MB")); + m_bigFilesLimitSpinBox->setSuffix(Tr::tr("MB")); m_bigFilesLimitSpinBox->setRange(1, 500); m_bigFilesLimitSpinBox->setValue(m_settings->indexerFileSizeLimitInMb()); - m_ignoreFilesCheckBox = new QCheckBox(tr("Ignore files")); - m_ignoreFilesCheckBox->setToolTip(tr( + m_ignoreFilesCheckBox = new QCheckBox(Tr::tr("Ignore files")); + m_ignoreFilesCheckBox->setToolTip(Tr::tr( "

Ignore files that match these wildcard patterns, one wildcard per line.

")); m_ignoreFilesCheckBox->setChecked(m_settings->ignoreFiles()); @@ -86,17 +85,17 @@ CppCodeModelSettingsWidget::CppCodeModelSettingsWidget(CppCodeModelSettings *s) m_ignorePatternTextEdit->setEnabled(m_ignoreFilesCheckBox->isChecked()); }); - m_ignorePchCheckBox = new QCheckBox(tr("Ignore precompiled headers")); - m_ignorePchCheckBox->setToolTip(tr( + m_ignorePchCheckBox = new QCheckBox(Tr::tr("Ignore precompiled headers")); + m_ignorePchCheckBox->setToolTip(Tr::tr( "

When precompiled headers are not ignored, the parsing for code " "completion and semantic highlighting will process the precompiled header before " "processing any file.

")); - m_useBuiltinPreprocessorCheckBox = new QCheckBox(tr("Use built-in preprocessor to show " - "pre-processed files")); + m_useBuiltinPreprocessorCheckBox = new QCheckBox(Tr::tr("Use built-in preprocessor to show " + "pre-processed files")); m_useBuiltinPreprocessorCheckBox->setToolTip - (tr("Uncheck this to invoke the actual compiler " - "to show a pre-processed source file in the editor.")); + (Tr::tr("Uncheck this to invoke the actual compiler " + "to show a pre-processed source file in the editor.")); m_interpretAmbiguousHeadersAsCHeaders->setChecked( m_settings->interpretAmbigiousHeadersAsCHeaders()); @@ -108,7 +107,7 @@ CppCodeModelSettingsWidget::CppCodeModelSettingsWidget(CppCodeModelSettings *s) Column { Group { - title(tr("General")), + title(Tr::tr("General")), Column { m_interpretAmbiguousHeadersAsCHeaders, m_ignorePchCheckBox, @@ -181,9 +180,9 @@ bool CppCodeModelSettingsWidget::applyGeneralWidgetsToSettings() const CppCodeModelSettingsPage::CppCodeModelSettingsPage(CppCodeModelSettings *settings) { setId(Constants::CPP_CODE_MODEL_SETTINGS_ID); - setDisplayName(CppCodeModelSettingsWidget::tr("Code Model")); + setDisplayName(Tr::tr("Code Model")); setCategory(Constants::CPP_SETTINGS_CATEGORY); - setDisplayCategory(QCoreApplication::translate("CppEditor", "C++")); + setDisplayCategory(Tr::tr("C++")); setCategoryIconPath(":/projectexplorer/images/settingscategory_cpp.png"); setWidgetCreator([settings] { return new CppCodeModelSettingsWidget(settings); }); } @@ -211,7 +210,7 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD : d(new Private) { const ClangdSettings settings(settingsData); - const QString indexingToolTip = tr( + const QString indexingToolTip = Tr::tr( "If background indexing is enabled, global symbol searches will yield\n" "more accurate results, at the cost of additional CPU load when\n" "the project is first opened.\n" @@ -225,22 +224,22 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD "unused.\n" "Normal Priority: Reduced priority compared to interactive work.\n" "Low Priority: Same priority as other clangd work."); - const QString workerThreadsToolTip = tr( + const QString workerThreadsToolTip = Tr::tr( "Number of worker threads used by clangd. Background indexing also uses this many " "worker threads."); - const QString autoIncludeToolTip = tr( + const QString autoIncludeToolTip = Tr::tr( "Controls whether clangd may insert header files as part of symbol completion."); - const QString documentUpdateToolTip = tr( + const QString documentUpdateToolTip = Tr::tr( "Defines the amount of time Qt Creator waits before sending document changes to the " "server.\n" "If the document changes again while waiting, this timeout resets."); - const QString sizeThresholdToolTip = tr( + const QString sizeThresholdToolTip = Tr::tr( "Files greater than this will not be opened as documents in clangd.\n" "The built-in code model will handle highlighting, completion and so on."); - const QString completionResultToolTip = tr( + const QString completionResultToolTip = Tr::tr( "The maximum number of completion results returned by clangd."); - d->useClangdCheckBox.setText(tr("Use clangd")); + d->useClangdCheckBox.setText(Tr::tr("Use clangd")); d->useClangdCheckBox.setChecked(settings.useClangd()); d->clangdChooser.setExpectedKind(Utils::PathChooser::ExistingCommand); d->clangdChooser.setFilePath(settings.clangdFilePath()); @@ -253,7 +252,7 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD d->indexingComboBox.setCurrentIndex(d->indexingComboBox.count() - 1); } d->indexingComboBox.setToolTip(indexingToolTip); - d->autoIncludeHeadersCheckBox.setText(tr("Insert header files on completion")); + d->autoIncludeHeadersCheckBox.setText(Tr::tr("Insert header files on completion")); d->autoIncludeHeadersCheckBox.setChecked(settings.autoIncludeHeaders()); d->autoIncludeHeadersCheckBox.setToolTip(autoIncludeToolTip); d->threadLimitSpinBox.setValue(settings.workerThreadLimit()); @@ -265,7 +264,7 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD d->documentUpdateThreshold.setSingleStep(100); d->documentUpdateThreshold.setSuffix(" ms"); d->documentUpdateThreshold.setToolTip(documentUpdateToolTip); - d->sizeThresholdCheckBox.setText(tr("Ignore files greater than")); + d->sizeThresholdCheckBox.setText(Tr::tr("Ignore files greater than")); d->sizeThresholdCheckBox.setChecked(settings.sizeThresholdEnabled()); d->sizeThresholdCheckBox.setToolTip(sizeThresholdToolTip); d->sizeThresholdSpinBox.setMinimum(1); @@ -274,34 +273,34 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD d->sizeThresholdSpinBox.setValue(settings.sizeThresholdInKb()); d->sizeThresholdSpinBox.setToolTip(sizeThresholdToolTip); - const auto completionResultsLabel = new QLabel(tr("Completion results:")); + const auto completionResultsLabel = new QLabel(Tr::tr("Completion results:")); completionResultsLabel->setToolTip(completionResultToolTip); d->completionResults.setMinimum(0); d->completionResults.setMaximum(std::numeric_limits::max()); d->completionResults.setValue(settings.completionResults()); d->completionResults.setToolTip(completionResultToolTip); - d->completionResults.setSpecialValueText(tr("No limit")); + d->completionResults.setSpecialValueText(Tr::tr("No limit")); const auto layout = new QVBoxLayout(this); layout->setContentsMargins(0, 0, 0, 0); layout->addWidget(&d->useClangdCheckBox); const auto formLayout = new QFormLayout; - const auto chooserLabel = new QLabel(tr("Path to executable:")); + const auto chooserLabel = new QLabel(Tr::tr("Path to executable:")); formLayout->addRow(chooserLabel, &d->clangdChooser); formLayout->addRow(QString(), &d->versionWarningLabel); const auto indexingPriorityLayout = new QHBoxLayout; indexingPriorityLayout->addWidget(&d->indexingComboBox); indexingPriorityLayout->addStretch(1); - const auto indexingPriorityLabel = new QLabel(tr("Background indexing:")); + const auto indexingPriorityLabel = new QLabel(Tr::tr("Background indexing:")); indexingPriorityLabel->setToolTip(indexingToolTip); formLayout->addRow(indexingPriorityLabel, indexingPriorityLayout); const auto threadLimitLayout = new QHBoxLayout; threadLimitLayout->addWidget(&d->threadLimitSpinBox); threadLimitLayout->addStretch(1); - const auto threadLimitLabel = new QLabel(tr("Worker thread count:")); + const auto threadLimitLabel = new QLabel(Tr::tr("Worker thread count:")); threadLimitLabel->setToolTip(workerThreadsToolTip); formLayout->addRow(threadLimitLabel, threadLimitLayout); @@ -314,7 +313,7 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD const auto documentUpdateThresholdLayout = new QHBoxLayout; documentUpdateThresholdLayout->addWidget(&d->documentUpdateThreshold); documentUpdateThresholdLayout->addStretch(1); - const auto documentUpdateThresholdLabel = new QLabel(tr("Document update threshold:")); + const auto documentUpdateThresholdLabel = new QLabel(Tr::tr("Document update threshold:")); documentUpdateThresholdLabel->setToolTip(documentUpdateToolTip); formLayout->addRow(documentUpdateThresholdLabel, documentUpdateThresholdLayout); const auto sizeThresholdLayout = new QHBoxLayout; @@ -334,18 +333,18 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD if (!isForProject) { d->sessionsModel.setStringList(settingsData.sessionsWithOneClangd); d->sessionsModel.sort(0); - d->sessionsGroupBox = new QGroupBox(tr("Sessions with a single clangd instance")); + d->sessionsGroupBox = new QGroupBox(Tr::tr("Sessions with a single clangd instance")); const auto sessionsView = new Utils::ListView; sessionsView->setModel(&d->sessionsModel); sessionsView->setToolTip( - tr("By default, Qt Creator runs one clangd process per project.\n" + Tr::tr("By default, Qt Creator runs one clangd process per project.\n" "If you have sessions with tightly coupled projects that should be\n" "managed by the same clangd process, add them here.")); const auto outerSessionsLayout = new QHBoxLayout; const auto innerSessionsLayout = new QHBoxLayout(d->sessionsGroupBox); const auto buttonsLayout = new QVBoxLayout; - const auto addButton = new QPushButton(tr("Add ...")); - const auto removeButton = new QPushButton(tr("Remove")); + const auto addButton = new QPushButton(Tr::tr("Add ...")); + const auto removeButton = new QPushButton(Tr::tr("Remove")); buttonsLayout->addWidget(addButton); buttonsLayout->addWidget(removeButton); buttonsLayout->addStretch(1); @@ -380,7 +379,7 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD if (sessions.isEmpty()) return; sessions.sort(); - dlg.setLabelText(tr("Choose a session:")); + dlg.setLabelText(Tr::tr("Choose a session:")); dlg.setComboBoxItems(sessions); if (dlg.exec() == QDialog::Accepted) { currentSessions << dlg.textValue(); @@ -391,7 +390,7 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD } const auto configFilesHelpLabel = new QLabel; - configFilesHelpLabel->setText(tr("Additional settings are available via " + configFilesHelpLabel->setText(Tr::tr("Additional settings are available via " "
clangd configuration files.
" "User-specific settings go here, " "project-specific settings can be configured by putting a .clangd file into " @@ -444,12 +443,12 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD const Utils::FilePath clangdPath = d->clangdChooser.filePath(); const QVersionNumber clangdVersion = ClangdSettings::clangdVersion(clangdPath); if (clangdVersion.isNull()) { - labelSetter.setWarning(tr("Failed to retrieve clangd version: " - "Unexpected clangd output.")); + labelSetter.setWarning(Tr::tr("Failed to retrieve clangd version: " + "Unexpected clangd output.")); return; } if (clangdVersion < QVersionNumber(14)) { - labelSetter.setWarning(tr("The clangd version is %1, but %2 or greater is required.") + labelSetter.setWarning(Tr::tr("The clangd version is %1, but %2 or greater is required.") .arg(clangdVersion.toString()).arg(14)); return; } @@ -505,8 +504,6 @@ ClangdSettings::Data ClangdSettingsWidget::settingsData() const class ClangdSettingsPageWidget final : public Core::IOptionsPageWidget { - Q_DECLARE_TR_FUNCTIONS(CppEditor::Internal::ClangdSettingsWidget) - public: ClangdSettingsPageWidget() : m_widget(ClangdSettings::instance().data(), false) { @@ -523,7 +520,7 @@ private: ClangdSettingsPage::ClangdSettingsPage() { setId(Constants::CPP_CLANGD_SETTINGS_ID); - setDisplayName(ClangdSettingsWidget::tr("Clangd")); + setDisplayName(Tr::tr("Clangd")); setCategory(Constants::CPP_SETTINGS_CATEGORY); setWidgetCreator([] { return new ClangdSettingsPageWidget; }); } diff --git a/src/plugins/cppeditor/cppcodestylesettingspage.cpp b/src/plugins/cppeditor/cppcodestylesettingspage.cpp index 8668155736c..ad7f1c4247c 100644 --- a/src/plugins/cppeditor/cppcodestylesettingspage.cpp +++ b/src/plugins/cppeditor/cppcodestylesettingspage.cpp @@ -7,6 +7,7 @@ #include "cppcodestylepreferences.h" #include "cppcodestylesnippets.h" #include "cppeditorconstants.h" +#include "cppeditortr.h" #include "cpppointerdeclarationformatter.h" #include "cpptoolssettings.h" @@ -82,78 +83,84 @@ static void applyRefactorings(QTextDocument *textDocument, TextEditorWidget *edi class CppCodeStylePreferencesWidgetPrivate { - Q_DECLARE_TR_FUNCTIONS(CppEditor::Internal::CppCodeStyleSettingsPage) - public: CppCodeStylePreferencesWidgetPrivate(CppCodeStylePreferencesWidget *widget) : q(widget) - , m_indentAccessSpecifiers(createCheckBox(tr("\"public\", \"protected\" and\n" - "\"private\" within class body"))) + , m_indentAccessSpecifiers(createCheckBox(Tr::tr("\"public\", \"protected\" and\n" + "\"private\" within class body"))) , m_indentDeclarationsRelativeToAccessSpecifiers( - createCheckBox(tr("Declarations relative to \"public\",\n" + createCheckBox(Tr::tr("Declarations relative to \"public\",\n" "\"protected\" and \"private\""))) - , m_indentFunctionBody(createCheckBox(tr("Statements within function body"))) - , m_indentBlockBody(createCheckBox(tr("Statements within blocks"))) - , m_indentNamespaceBody(createCheckBox(tr("Declarations within\n" + , m_indentFunctionBody(createCheckBox(Tr::tr("Statements within function body"))) + , m_indentBlockBody(createCheckBox(Tr::tr("Statements within blocks"))) + , m_indentNamespaceBody(createCheckBox(Tr::tr("Declarations within\n" "\"namespace\" definition"))) - , m_indentClassBraces(createCheckBox(tr("Class declarations"))) - , m_indentNamespaceBraces(createCheckBox(tr("Namespace declarations"))) - , m_indentEnumBraces(createCheckBox(tr("Enum declarations"))) - , m_indentFunctionBraces(createCheckBox(tr("Function declarations"))) - , m_indentBlockBraces(createCheckBox(tr("Blocks"))) - , m_indentSwitchLabels(createCheckBox(tr("\"case\" or \"default\""))) - , m_indentCaseStatements(createCheckBox(tr("Statements relative to\n" + , m_indentClassBraces(createCheckBox(Tr::tr("Class declarations"))) + , m_indentNamespaceBraces(createCheckBox(Tr::tr("Namespace declarations"))) + , m_indentEnumBraces(createCheckBox(Tr::tr("Enum declarations"))) + , m_indentFunctionBraces(createCheckBox(Tr::tr("Function declarations"))) + , m_indentBlockBraces(createCheckBox(Tr::tr("Blocks"))) + , m_indentSwitchLabels(createCheckBox(Tr::tr("\"case\" or \"default\""))) + , m_indentCaseStatements(createCheckBox(Tr::tr("Statements relative to\n" "\"case\" or \"default\""))) - , m_indentCaseBlocks(createCheckBox(tr("Blocks relative to\n" + , m_indentCaseBlocks(createCheckBox(Tr::tr("Blocks relative to\n" "\"case\" or \"default\""))) - , m_indentCaseBreak(createCheckBox(tr("\"break\" statement relative to\n" + , m_indentCaseBreak(createCheckBox(Tr::tr("\"break\" statement relative to\n" "\"case\" or \"default\""))) - , m_alignAssignments(createCheckBox(tr("Align after assignments"), - tr("\n" - "Enables alignment to tokens after =, += etc. When the option is disabled, regular continuation line indentation will be used.
\n" - "
\n" - "With alignment:\n" - "
\n"
-                                               "a = a +\n"
-                                               "    b\n"
-                                               "
\n" - "Without alignment:\n" - "
\n"
-                                               "a = a +\n"
-                                               "        b\n"
-                                               "
\n" - ""))) - , m_extraPaddingConditions(createCheckBox(tr("Add extra padding to conditions\n" - "if they would align to the next line"), - tr("\n" - "Adds an extra level of indentation to multiline conditions in the switch, if, while and foreach statements if they would otherwise have the same or less indentation than a nested statement.\n" - "\n" - "For four-spaces indentation only if statement conditions are affected. Without extra padding:\n" - "
\n"
-                                                     "if (a &&\n"
-                                                     "    b)\n"
-                                                     "    c;\n"
-                                                     "
\n" - "With extra padding:\n" - "
\n"
-                                                     "if (a &&\n"
-                                                     "        b)\n"
-                                                     "    c;\n"
-                                                     "
\n" - ""))) - , m_bindStarToIdentifier(createCheckBox(tr("Identifier"), - tr("This does not apply to the star and reference symbol in pointer/reference to functions and arrays, e.g.:\n" - "
   int (&rf)() = ...;\n"
-                                                   "   int (*pf)() = ...;\n"
-                                                   "\n"
-                                                   "   int (&ra)[2] = ...;\n"
-                                                   "   int (*pa)[2] = ...;\n"
-                                                   "\n"
-                                                   "
"))) - , m_bindStarToTypeName(createCheckBox(tr("Type name"))) - , m_bindStarToLeftSpecifier(createCheckBox(tr("Left const/volatile"))) - , m_bindStarToRightSpecifier(createCheckBox(tr("Right const/volatile"), - tr("This does not apply to references."))) + , m_alignAssignments(createCheckBox( + Tr::tr("Align after assignments"), + Tr::tr("\n" + "Enables alignment to tokens after =, += etc. When the option is disabled, " + "regular continuation line indentation will be used.
\n" + "
\n" + "With alignment:\n" + "
\n"
+                   "a = a +\n"
+                   "    b\n"
+                   "
\n" + "Without alignment:\n" + "
\n"
+                   "a = a +\n"
+                   "        b\n"
+                   "
\n" + ""))) + , m_extraPaddingConditions(createCheckBox( + Tr::tr("Add extra padding to conditions\n" + "if they would align to the next line"), + Tr::tr("\n" + "Adds an extra level of indentation to multiline conditions in the switch, " + "if, while and foreach statements if they would otherwise have the same or " + "less indentation than a nested statement.\n" + "\n" + "For four-spaces indentation only if statement conditions are affected. " + "Without extra padding:\n" + "
\n"
+                   "if (a &&\n"
+                   "    b)\n"
+                   "    c;\n"
+                   "
\n" + "With extra padding:\n" + "
\n"
+                   "if (a &&\n"
+                   "        b)\n"
+                   "    c;\n"
+                   "
\n" + ""))) + , m_bindStarToIdentifier(createCheckBox( + Tr::tr("Identifier"), + Tr::tr("This does not apply to the star and reference symbol " + "in pointer/reference to functions and arrays, e.g.:\n" + "
   int (&rf)() = ...;\n"
+               "   int (*pf)() = ...;\n"
+               "\n"
+               "   int (&ra)[2] = ...;\n"
+               "   int (*pa)[2] = ...;\n"
+               "\n"
+               "
"))) + , m_bindStarToTypeName(createCheckBox(Tr::tr("Type name"))) + , m_bindStarToLeftSpecifier(createCheckBox(Tr::tr("Left const/volatile"))) + , m_bindStarToRightSpecifier(createCheckBox(Tr::tr("Right const/volatile"), + Tr::tr("This does not apply to references."))) , m_categoryTab(new QTabWidget) , m_tabSettingsWidget(new TabSettingsWidget) { @@ -178,12 +185,12 @@ public: }, createPreview(0) }.attachTo(generalTab); - m_categoryTab->addTab(generalTab, tr("General")); + m_categoryTab->addTab(generalTab, Tr::tr("General")); m_controllers.append(m_tabSettingsWidget); QWidget *contentTab = new QWidget; Group contentGroup { - title(tr("Indent")), + title(Tr::tr("Indent")), Column { m_indentAccessSpecifiers, m_indentDeclarationsRelativeToAccessSpecifiers, @@ -197,12 +204,12 @@ public: contentGroup, createPreview(1) }.attachTo(contentTab); - m_categoryTab->addTab(contentTab, tr("Content")); + m_categoryTab->addTab(contentTab, Tr::tr("Content")); m_controllers.append(contentGroup.widget); QWidget *bracesTab = new QWidget; Group bracesGroup { - title(tr("Indent Braces")), + title(Tr::tr("Indent Braces")), Column { m_indentClassBraces, m_indentNamespaceBraces, @@ -216,12 +223,12 @@ public: bracesGroup, createPreview(2) }.attachTo(bracesTab); - m_categoryTab->addTab(bracesTab, tr("Braces")); + m_categoryTab->addTab(bracesTab, Tr::tr("Braces")); m_controllers.append(bracesGroup.widget); QWidget *switchTab = new QWidget; Group switchGroup { - title(tr("Indent within \"switch\"")), + title(Tr::tr("Indent within \"switch\"")), Column { m_indentSwitchLabels, m_indentCaseStatements, @@ -234,12 +241,12 @@ public: switchGroup, createPreview(3) }.attachTo(switchTab); - m_categoryTab->addTab(switchTab, tr("\"switch\"")); + m_categoryTab->addTab(switchTab, Tr::tr("\"switch\"")); m_controllers.append(switchGroup.widget); QWidget *alignmentTab = new QWidget; Group alignmentGroup { - title(tr("Align")), + title(Tr::tr("Align")), Column { m_alignAssignments, m_extraPaddingConditions, @@ -250,12 +257,12 @@ public: alignmentGroup, createPreview(4) }.attachTo(alignmentTab); - m_categoryTab->addTab(alignmentTab, tr("Alignment")); + m_categoryTab->addTab(alignmentTab, Tr::tr("Alignment")); m_controllers.append(alignmentGroup.widget); QWidget *typesTab = new QWidget; Group typesGroup { - title(tr("Bind '*' and '&&' in types/declarations to")), + title(Tr::tr("Bind '*' and '&&' in types/declarations to")), Column { m_bindStarToIdentifier, m_bindStarToTypeName, @@ -268,7 +275,7 @@ public: typesGroup, createPreview(5) }.attachTo(typesTab); - m_categoryTab->addTab(typesTab, tr("Pointers and References")); + m_categoryTab->addTab(typesTab, Tr::tr("Pointers and References")); m_controllers.append(typesGroup.widget); Row { m_categoryTab }.attachTo(q); @@ -574,7 +581,7 @@ void CppCodeStylePreferencesWidget::finish() CppCodeStyleSettingsPage::CppCodeStyleSettingsPage() { setId(Constants::CPP_CODE_STYLE_SETTINGS_ID); - setDisplayName(QCoreApplication::translate("CppEditor", Constants::CPP_CODE_STYLE_SETTINGS_NAME)); + setDisplayName(Tr::tr("Code Style")); setCategory(Constants::CPP_SETTINGS_CATEGORY); } diff --git a/src/plugins/cppeditor/cppeditorconstants.h b/src/plugins/cppeditor/cppeditorconstants.h index efc6a5d8751..638070f4c77 100644 --- a/src/plugins/cppeditor/cppeditorconstants.h +++ b/src/plugins/cppeditor/cppeditorconstants.h @@ -11,7 +11,6 @@ namespace Constants { const char M_CONTEXT[] = "CppEditor.ContextMenu"; const char G_CONTEXT_FIRST[] = "CppEditor.GFirst"; const char CPPEDITOR_ID[] = "CppEditor.C++Editor"; -const char CPPEDITOR_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("OpenWith::Editors", "C++ Editor"); const char SWITCH_DECLARATION_DEFINITION[] = "CppEditor.SwitchDeclarationDefinition"; const char OPEN_DECLARATION_DEFINITION_IN_NEXT_SPLIT[] = "CppEditor.OpenDeclarationDefinitionInNextSplit"; const char FOLLOW_SYMBOL_TO_TYPE[] = "TextEditor.FollowSymbolToType"; @@ -96,12 +95,9 @@ const char CPP_CLANG_DIAG_CONFIG_QUESTIONABLE[] = "Builtin.Questionable"; const char CPP_CLANG_DIAG_CONFIG_BUILDSYSTEM[] = "Builtin.BuildSystem"; const char CPP_CODE_STYLE_SETTINGS_ID[] = "A.Cpp.Code Style"; -const char CPP_CODE_STYLE_SETTINGS_NAME[] = QT_TRANSLATE_NOOP("CppEditor", "Code Style"); const char CPP_FILE_SETTINGS_ID[] = "B.Cpp.File Naming"; -const char CPP_FILE_SETTINGS_NAME[] = QT_TRANSLATE_NOOP("CppEditor", "File Naming"); const char CPP_CODE_MODEL_SETTINGS_ID[] = "C.Cpp.Code Model"; const char CPP_DIAGNOSTIC_CONFIG_SETTINGS_ID[] = "C.Cpp.Diagnostic Config"; -const char CPP_DIAGNOSTIC_CONFIG_SETTINGS_NAME[] = QT_TRANSLATE_NOOP("CppEditor", "Diagnostic Configurations"); const char CPP_CLANGD_SETTINGS_ID[] = "K.Cpp.Clangd"; const char CPP_SETTINGS_CATEGORY[] = "I.C++"; diff --git a/src/plugins/cppeditor/cppeditordocument.cpp b/src/plugins/cppeditor/cppeditordocument.cpp index 6156b37cd31..d7039b2c2cc 100644 --- a/src/plugins/cppeditor/cppeditordocument.cpp +++ b/src/plugins/cppeditor/cppeditordocument.cpp @@ -7,6 +7,7 @@ #include "cppcodeformatter.h" #include "cppeditorconstants.h" #include "cppeditorplugin.h" +#include "cppeditortr.h" #include "cppmodelmanager.h" #include "cppeditorconstants.h" #include "cppeditorplugin.h" @@ -110,8 +111,8 @@ CppEditorDocument::CppEditorDocument() minimizableInfoBars()->setSettingsGroup(Constants::CPPEDITOR_SETTINGSGROUP); minimizableInfoBars()->setPossibleInfoBarEntries( {{NO_PROJECT_CONFIGURATION, - tr("Warning: This file is not part of any project. " - "The code model might have issues parsing this file properly.")}}); + Tr::tr("Warning: This file is not part of any project. " + "The code model might have issues parsing this file properly.")}}); // See also onFilePathChanged() for more initialization } @@ -343,8 +344,8 @@ void CppEditorDocument::showHideInfoBarAboutMultipleParseContexts(bool show) if (show) { InfoBarEntry info(id, - tr("Note: Multiple parse contexts are available for this file. " - "Choose the preferred one from the editor toolbar."), + Tr::tr("Note: Multiple parse contexts are available for this file. " + "Choose the preferred one from the editor toolbar."), InfoBarEntry::GlobalSuppression::Enabled); info.removeCancelButton(); if (infoBar()->canInfoBeAdded(id)) diff --git a/src/plugins/cppeditor/cppeditoroutline.cpp b/src/plugins/cppeditor/cppeditoroutline.cpp index 13c4ca7addf..b0d14ca1192 100644 --- a/src/plugins/cppeditor/cppeditoroutline.cpp +++ b/src/plugins/cppeditor/cppeditoroutline.cpp @@ -4,6 +4,7 @@ #include "cppeditoroutline.h" #include "cppeditordocument.h" +#include "cppeditortr.h" #include "cppeditorwidget.h" #include "cppmodelmanager.h" #include "cppoutlinemodel.h" @@ -95,7 +96,7 @@ CppEditorOutline::CppEditorOutline(CppEditorWidget *editorWidget) m_combo->setMaxVisibleItems(40); m_combo->setContextMenuPolicy(Qt::ActionsContextMenu); - m_sortAction = new QAction(tr("Sort Alphabetically"), m_combo); + m_sortAction = new QAction(Tr::tr("Sort Alphabetically"), m_combo); m_sortAction->setCheckable(true); m_sortAction->setChecked(isSorted()); connect(m_sortAction, &QAction::toggled, diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index 20a90c22025..a732ab0aef9 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -10,6 +10,7 @@ #include "cppcodestylesettingspage.h" #include "cppeditorconstants.h" #include "cppeditordocument.h" +#include "cppeditortr.h" #include "cppeditorwidget.h" #include "cppfilesettingspage.h" #include "cppincludehierarchy.h" @@ -124,7 +125,7 @@ public: CppEditorFactory() { setId(Constants::CPPEDITOR_ID); - setDisplayName(QCoreApplication::translate("OpenWith::Editors", Constants::CPPEDITOR_DISPLAY_NAME)); + setDisplayName(QCoreApplication::translate("OpenWith::Editors","C++ Editor")); addMimeType(Constants::C_SOURCE_MIMETYPE); addMimeType(Constants::C_HEADER_MIMETYPE); addMimeType(Constants::CPP_SOURCE_MIMETYPE); @@ -237,53 +238,53 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS); ActionContainer *mcpptools = ActionManager::createMenu(Constants::M_TOOLS_CPP); QMenu *menu = mcpptools->menu(); - menu->setTitle(tr("&C++")); + menu->setTitle(Tr::tr("&C++")); menu->setEnabled(true); mtools->addMenu(mcpptools); // Actions Context context(Constants::CPPEDITOR_ID); - QAction *switchAction = new QAction(tr("Switch Header/Source"), this); + QAction *switchAction = new QAction(Tr::tr("Switch Header/Source"), this); Command *command = ActionManager::registerAction(switchAction, Constants::SWITCH_HEADER_SOURCE, context, true); command->setDefaultKeySequence(QKeySequence(Qt::Key_F4)); mcpptools->addAction(command); connect(switchAction, &QAction::triggered, this, [] { CppModelManager::switchHeaderSource(false); }); - QAction *openInNextSplitAction = new QAction(tr("Open Corresponding Header/Source in Next Split"), this); + QAction *openInNextSplitAction = new QAction(Tr::tr("Open Corresponding Header/Source in Next Split"), this); command = ActionManager::registerAction(openInNextSplitAction, Constants::OPEN_HEADER_SOURCE_IN_NEXT_SPLIT, context, true); command->setDefaultKeySequence(QKeySequence(HostOsInfo::isMacHost() - ? tr("Meta+E, F4") - : tr("Ctrl+E, F4"))); + ? Tr::tr("Meta+E, F4") + : Tr::tr("Ctrl+E, F4"))); mcpptools->addAction(command); connect(openInNextSplitAction, &QAction::triggered, this, [] { CppModelManager::switchHeaderSource(true); }); MacroExpander *expander = globalMacroExpander(); expander->registerVariable("Cpp:LicenseTemplate", - tr("The license template."), + Tr::tr("The license template."), []() { return CppEditorPlugin::licenseTemplate(); }); expander->registerFileVariables("Cpp:LicenseTemplatePath", - tr("The configured path to the license template"), + Tr::tr("The configured path to the license template"), []() { return CppEditorPlugin::licenseTemplatePath(); }); expander->registerVariable( "Cpp:PragmaOnce", - tr("Insert \"#pragma once\" instead of \"#ifndef\" include guards into header file"), + Tr::tr("Insert \"#pragma once\" instead of \"#ifndef\" include guards into header file"), [] { return usePragmaOnce() ? QString("true") : QString(); }); const auto quickFixSettingsPanelFactory = new ProjectPanelFactory; quickFixSettingsPanelFactory->setPriority(100); quickFixSettingsPanelFactory->setId(Constants::QUICK_FIX_PROJECT_PANEL_ID); quickFixSettingsPanelFactory->setDisplayName( - QCoreApplication::translate("CppEditor", Constants::QUICK_FIX_SETTINGS_DISPLAY_NAME)); + Tr::tr("CppEditor", Constants::QUICK_FIX_SETTINGS_DISPLAY_NAME)); quickFixSettingsPanelFactory->setCreateWidgetFunction([](Project *project) { return new CppQuickFixProjectSettingsWidget(project); }); ProjectPanelFactory::registerFactory(quickFixSettingsPanelFactory); - SnippetProvider::registerGroup(Constants::CPP_SNIPPETS_GROUP_ID, tr("C++", "SnippetProvider"), + SnippetProvider::registerGroup(Constants::CPP_SNIPPETS_GROUP_ID, Tr::tr("C++", "SnippetProvider"), &decorateCppEditor); createCppQuickFixes(); @@ -296,28 +297,28 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err ActionContainer *touchBar = ActionManager::actionContainer(Core::Constants::TOUCH_BAR); cmd = ActionManager::command(Constants::SWITCH_HEADER_SOURCE); - cmd->setTouchBarText(tr("Header/Source", "text on macOS touch bar")); + cmd->setTouchBarText(Tr::tr("Header/Source", "text on macOS touch bar")); contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_NAVIGATION); cmd = ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR); - cmd->setTouchBarText(tr("Follow", "text on macOS touch bar")); + cmd->setTouchBarText(Tr::tr("Follow", "text on macOS touch bar")); contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); cppToolsMenu->addAction(cmd); touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_NAVIGATION); - QAction *openPreprocessorDialog = new QAction(tr("Additional Preprocessor Directives..."), this); + QAction *openPreprocessorDialog = new QAction(Tr::tr("Additional Preprocessor Directives..."), this); cmd = ActionManager::registerAction(openPreprocessorDialog, Constants::OPEN_PREPROCESSOR_DIALOG, context); cmd->setDefaultKeySequence(QKeySequence()); connect(openPreprocessorDialog, &QAction::triggered, this, &CppEditorPlugin::showPreProcessorDialog); cppToolsMenu->addAction(cmd); - QAction *switchDeclarationDefinition = new QAction(tr("Switch Between Function Declaration/Definition"), this); + QAction *switchDeclarationDefinition = new QAction(Tr::tr("Switch Between Function Declaration/Definition"), this); cmd = ActionManager::registerAction(switchDeclarationDefinition, Constants::SWITCH_DECLARATION_DEFINITION, context, true); - cmd->setDefaultKeySequence(QKeySequence(tr("Shift+F2"))); - cmd->setTouchBarText(tr("Decl/Def", "text on macOS touch bar")); + cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Shift+F2"))); + cmd->setTouchBarText(Tr::tr("Decl/Def", "text on macOS touch bar")); connect(switchDeclarationDefinition, &QAction::triggered, this, &CppEditorPlugin::switchDeclarationDefinition); contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); @@ -328,21 +329,21 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err cppToolsMenu->addAction(cmd); QAction *openDeclarationDefinitionInNextSplit = - new QAction(tr("Open Function Declaration/Definition in Next Split"), this); + new QAction(Tr::tr("Open Function Declaration/Definition in Next Split"), this); cmd = ActionManager::registerAction(openDeclarationDefinitionInNextSplit, Constants::OPEN_DECLARATION_DEFINITION_IN_NEXT_SPLIT, context, true); cmd->setDefaultKeySequence(QKeySequence(HostOsInfo::isMacHost() - ? tr("Meta+E, Shift+F2") - : tr("Ctrl+E, Shift+F2"))); + ? Tr::tr("Meta+E, Shift+F2") + : Tr::tr("Ctrl+E, Shift+F2"))); connect(openDeclarationDefinitionInNextSplit, &QAction::triggered, this, &CppEditorPlugin::openDeclarationDefinitionInNextSplit); cppToolsMenu->addAction(cmd); - QAction * const followSymbolToType = new QAction(tr("Follow Symbol Under Cursor to Type"), + QAction * const followSymbolToType = new QAction(Tr::tr("Follow Symbol Under Cursor to Type"), this); cmd = ActionManager::registerAction(followSymbolToType, Constants::FOLLOW_SYMBOL_TO_TYPE, context, true); - cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+F2"))); + cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+Shift+F2"))); connect(followSymbolToType, &QAction::triggered, this, []{ if (CppEditorWidget *editorWidget = currentCppEditorWidget()) editorWidget->followSymbolToType(false); @@ -350,12 +351,12 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); cppToolsMenu->addAction(cmd); QAction * const followSymbolToTypeInNextSplit = - new QAction(tr("Follow Symbol to Type in Next Split"), this); + new QAction(Tr::tr("Follow Symbol to Type in Next Split"), this); cmd = ActionManager::registerAction(followSymbolToTypeInNextSplit, Constants::FOLLOW_SYMBOL_TO_TYPE_IN_NEXT_SPLIT, context, true); cmd->setDefaultKeySequence(QKeySequence(HostOsInfo::isMacHost() - ? tr("Meta+E, Ctrl+Shift+F2") - : tr("Ctrl+E, Ctrl+Shift+F2"))); + ? Tr::tr("Meta+E, Ctrl+Shift+F2") + : Tr::tr("Ctrl+E, Ctrl+Shift+F2"))); connect(followSymbolToTypeInNextSplit, &QAction::triggered, this, []{ if (CppEditorWidget *editorWidget = currentCppEditorWidget()) editorWidget->followSymbolToType(true); @@ -366,7 +367,7 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); cppToolsMenu->addAction(cmd); - d->m_findRefsCategorizedAction = new QAction(tr("Find References With Access Type"), this); + d->m_findRefsCategorizedAction = new QAction(Tr::tr("Find References With Access Type"), this); cmd = ActionManager::registerAction(d->m_findRefsCategorizedAction, "CppEditor.FindRefsCategorized", context); connect(d->m_findRefsCategorizedAction, &QAction::triggered, this, [this] { @@ -379,7 +380,7 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); cppToolsMenu->addAction(cmd); - QAction * const showPreprocessedAction = new QAction(tr("Show Preprocessed Source"), this); + QAction * const showPreprocessedAction = new QAction(Tr::tr("Show Preprocessed Source"), this); command = ActionManager::registerAction(showPreprocessedAction, Constants::SHOW_PREPROCESSED_FILE, context); mcpptools->addAction(command); @@ -388,14 +389,14 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err this, [] { CppModelManager::showPreprocessedFile(false); }); QAction * const showPreprocessedInSplitAction = new QAction - (tr("Show Preprocessed Source in Next Split"), this); + (Tr::tr("Show Preprocessed Source in Next Split"), this); command = ActionManager::registerAction(showPreprocessedInSplitAction, Constants::SHOW_PREPROCESSED_FILE_SPLIT, context); mcpptools->addAction(command); connect(showPreprocessedInSplitAction, &QAction::triggered, this, [] { CppModelManager::showPreprocessedFile(true); }); - QAction *const findUnusedFunctionsAction = new QAction(tr("Find Unused Functions"), this); + QAction *const findUnusedFunctionsAction = new QAction(Tr::tr("Find Unused Functions"), this); command = ActionManager::registerAction(findUnusedFunctionsAction, "CppTools.FindUnusedFunctions"); mcpptools->addAction(command); @@ -403,7 +404,7 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err CppModelManager::findUnusedFunctions({}); }); QAction *const findUnusedFunctionsInSubProjectAction - = new QAction(tr("Find Unused C/C++ Functions"), this); + = new QAction(Tr::tr("Find Unused C/C++ Functions"), this); command = ActionManager::registerAction(findUnusedFunctionsInSubProjectAction, "CppTools.FindUnusedFunctionsInSubProject"); for (ActionContainer *const projectContextMenu : @@ -417,16 +418,16 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err CppModelManager::findUnusedFunctions(node->directory()); }); - d->m_openTypeHierarchyAction = new QAction(tr("Open Type Hierarchy"), this); + d->m_openTypeHierarchyAction = new QAction(Tr::tr("Open Type Hierarchy"), this); cmd = ActionManager::registerAction(d->m_openTypeHierarchyAction, Constants::OPEN_TYPE_HIERARCHY, context); - cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Shift+T") : tr("Ctrl+Shift+T"))); + cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+Shift+T") : Tr::tr("Ctrl+Shift+T"))); connect(d->m_openTypeHierarchyAction, &QAction::triggered, this, &CppEditorPlugin::openTypeHierarchy); contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); cppToolsMenu->addAction(cmd); - d->m_openIncludeHierarchyAction = new QAction(tr("Open Include Hierarchy"), this); + d->m_openIncludeHierarchyAction = new QAction(Tr::tr("Open Include Hierarchy"), this); cmd = ActionManager::registerAction(d->m_openIncludeHierarchyAction, Constants::OPEN_INCLUDE_HIERARCHY, context); - cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Shift+I") : tr("Ctrl+Shift+I"))); + cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+Shift+I") : Tr::tr("Ctrl+Shift+I"))); connect(d->m_openIncludeHierarchyAction, &QAction::triggered, this, &CppEditorPlugin::openIncludeHierarchy); contextMenu->addAction(cmd, Constants::G_CONTEXT_FIRST); cppToolsMenu->addAction(cmd); @@ -439,7 +440,7 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err // Update context in global context cppToolsMenu->addSeparator(Core::Constants::G_DEFAULT_THREE); - d->m_reparseExternallyChangedFiles = new QAction(tr("Reparse Externally Changed Files"), this); + d->m_reparseExternallyChangedFiles = new QAction(Tr::tr("Reparse Externally Changed Files"), this); cmd = ActionManager::registerAction(d->m_reparseExternallyChangedFiles, Constants::UPDATE_CODEMODEL); CppModelManager *cppModelManager = CppModelManager::instance(); connect(d->m_reparseExternallyChangedFiles, &QAction::triggered, @@ -447,9 +448,9 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err cppToolsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE); ActionContainer *toolsDebug = ActionManager::actionContainer(Core::Constants::M_TOOLS_DEBUG); - QAction *inspectCppCodeModel = new QAction(tr("Inspect C++ Code Model..."), this); + QAction *inspectCppCodeModel = new QAction(Tr::tr("Inspect C++ Code Model..."), this); cmd = ActionManager::registerAction(inspectCppCodeModel, Constants::INSPECT_CPP_CODEMODEL); - cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Meta+Shift+F12") : tr("Ctrl+Shift+F12"))); + cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+Shift+F12") : Tr::tr("Ctrl+Shift+F12"))); connect(inspectCppCodeModel, &QAction::triggered, d, &CppEditorPluginPrivate::inspectCppCodeModel); toolsDebug->addAction(cmd); @@ -479,7 +480,7 @@ void CppEditorPlugin::extensionsInitialized() d->m_clangdSettingsPage = new ClangdSettingsPage; const auto clangdPanelFactory = new ProjectPanelFactory; clangdPanelFactory->setPriority(100); - clangdPanelFactory->setDisplayName(tr("Clangd")); + clangdPanelFactory->setDisplayName(Tr::tr("Clangd")); clangdPanelFactory->setCreateWidgetFunction([](Project *project) { return new ClangdProjectSettingsWidget(project); }); diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index e1267533bc5..acf4e88fef3 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -5,20 +5,21 @@ #include "cppcodeformatter.h" #include "cppcompletionassistprovider.h" -#include "doxygengenerator.h" #include "cppeditorconstants.h" #include "cppeditordocument.h" #include "cppeditoroutline.h" #include "cppeditorplugin.h" +#include "cppeditortr.h" #include "cppfunctiondecldeflink.h" #include "cpplocalrenaming.h" #include "cppmodelmanager.h" #include "cpppreprocessordialog.h" -#include "cppsemanticinfo.h" -#include "cppselectionchanger.h" #include "cppquickfixassistant.h" +#include "cppselectionchanger.h" +#include "cppsemanticinfo.h" #include "cpptoolssettings.h" #include "cppuseselectionsupdater.h" +#include "doxygengenerator.h" #include #include @@ -47,6 +48,7 @@ #include #include #include + #include #include #include @@ -1017,8 +1019,6 @@ static void addRefactoringActions(QMenu *menu, std::unique_ptr class ProgressIndicatorMenuItem : public QWidgetAction { - Q_OBJECT - public: ProgressIndicatorMenuItem(QObject *parent) : QWidgetAction(parent) {} @@ -1031,7 +1031,7 @@ protected: QMenu *CppEditorWidget::createRefactorMenu(QWidget *parent) const { - auto *menu = new QMenu(tr("&Refactor"), parent); + auto *menu = new QMenu(Tr::tr("&Refactor"), parent); menu->addAction(ActionManager::command(TextEditor::Constants::RENAME_SYMBOL)->action()); // ### enable @@ -1411,5 +1411,3 @@ void CppEditorWidget::enableTestMode() { d->inTestMode = true; } #endif } // namespace CppEditor - -#include "cppeditorwidget.moc" diff --git a/src/plugins/cppeditor/cppfilesettingspage.cpp b/src/plugins/cppeditor/cppfilesettingspage.cpp index fd6595540ef..9459aefa621 100644 --- a/src/plugins/cppeditor/cppfilesettingspage.cpp +++ b/src/plugins/cppeditor/cppfilesettingspage.cpp @@ -4,6 +4,7 @@ #include "cppfilesettingspage.h" #include "cppeditorplugin.h" +#include "cppeditortr.h" #include @@ -38,7 +39,7 @@ const char sourceSearchPathsKeyC[] = "SourceSearchPaths"; const char headerPragmaOnceC[] = "HeaderPragmaOnce"; const char licenseTemplatePathKeyC[] = "LicenseTemplate"; -const char *licenseTemplateTemplate = QT_TRANSLATE_NOOP("CppEditor::Internal::CppFileSettingsWidget", +const char *licenseTemplateTemplate = QT_TRANSLATE_NOOP("CppEditor", "/**************************************************************************\n" "** %1 license header template\n" "** Special keywords: %USER% %DATE% %YEAR%\n" @@ -234,8 +235,6 @@ QString CppFileSettings::licenseTemplate() class CppFileSettingsWidget final : public Core::IOptionsPageWidget { - Q_DECLARE_TR_FUNCTIONS(CppEditor::Internal::CppFileSettingsPage) - public: explicit CppFileSettingsWidget(CppFileSettings *settings); @@ -265,29 +264,29 @@ CppFileSettingsWidget::CppFileSettingsWidget(CppFileSettings *settings) , m_headerSuffixComboBox(new QComboBox) , m_headerSearchPathsEdit(new QLineEdit) , m_headerPrefixesEdit(new QLineEdit) - , m_headerPragmaOnceCheckBox(new QCheckBox(tr("Use \"#pragma once\" instead of \"#ifndef\" guards"))) + , m_headerPragmaOnceCheckBox(new QCheckBox(Tr::tr("Use \"#pragma once\" instead of \"#ifndef\" guards"))) , m_sourceSuffixComboBox(new QComboBox) , m_sourceSearchPathsEdit(new QLineEdit) , m_sourcePrefixesEdit(new QLineEdit) - , m_lowerCaseFileNamesCheckBox(new QCheckBox(tr("&Lower case file names"))) + , m_lowerCaseFileNamesCheckBox(new QCheckBox(Tr::tr("&Lower case file names"))) , m_licenseTemplatePathChooser(new PathChooser) { - m_headerSearchPathsEdit->setToolTip(tr("Comma-separated list of header paths.\n" + m_headerSearchPathsEdit->setToolTip(Tr::tr("Comma-separated list of header paths.\n" "\n" "Paths can be absolute or relative to the directory of the current open document.\n" "\n" "These paths are used in addition to current directory on Switch Header/Source.")); - m_headerPrefixesEdit->setToolTip(tr("Comma-separated list of header prefixes.\n" + m_headerPrefixesEdit->setToolTip(Tr::tr("Comma-separated list of header prefixes.\n" "\n" "These prefixes are used in addition to current file name on Switch Header/Source.")); m_headerPragmaOnceCheckBox->setToolTip( - tr("Uses \"#pragma once\" instead of \"#ifndef\" include guards.")); - m_sourceSearchPathsEdit->setToolTip(tr("Comma-separated list of source paths.\n" + Tr::tr("Uses \"#pragma once\" instead of \"#ifndef\" include guards.")); + m_sourceSearchPathsEdit->setToolTip(Tr::tr("Comma-separated list of source paths.\n" "\n" "Paths can be absolute or relative to the directory of the current open document.\n" "\n" "These paths are used in addition to current directory on Switch Header/Source.")); - m_sourcePrefixesEdit->setToolTip(tr("Comma-separated list of source prefixes.\n" + m_sourcePrefixesEdit->setToolTip(Tr::tr("Comma-separated list of source prefixes.\n" "\n" "These prefixes are used in addition to current file name on Switch Header/Source.")); @@ -297,23 +296,23 @@ CppFileSettingsWidget::CppFileSettingsWidget(CppFileSettings *settings) Group { title("Headers"), Form { - tr("&Suffix:"), m_headerSuffixComboBox, st, br, - tr("S&earch paths:"), m_headerSearchPathsEdit, br, - tr("&Prefixes:"), m_headerPrefixesEdit, br, - tr("Include guards"), m_headerPragmaOnceCheckBox + Tr::tr("&Suffix:"), m_headerSuffixComboBox, st, br, + Tr::tr("S&earch paths:"), m_headerSearchPathsEdit, br, + Tr::tr("&Prefixes:"), m_headerPrefixesEdit, br, + Tr::tr("Include guards"), m_headerPragmaOnceCheckBox } }, Group { title("Sources"), Form { - tr("S&uffix:"), m_sourceSuffixComboBox, st, br, - tr("Se&arch paths:"), m_sourceSearchPathsEdit, br, - tr("P&refixes:"), m_sourcePrefixesEdit + Tr::tr("S&uffix:"), m_sourceSuffixComboBox, st, br, + Tr::tr("Se&arch paths:"), m_sourceSearchPathsEdit, br, + Tr::tr("P&refixes:"), m_sourcePrefixesEdit } }, m_lowerCaseFileNamesCheckBox, Form { - tr("License &template:"), m_licenseTemplatePathChooser + Tr::tr("License &template:"), m_licenseTemplatePathChooser }, st }.attachTo(this); @@ -334,7 +333,7 @@ CppFileSettingsWidget::CppFileSettingsWidget(CppFileSettings *settings) } m_licenseTemplatePathChooser->setExpectedKind(PathChooser::File); m_licenseTemplatePathChooser->setHistoryCompleter(QLatin1String("Cpp.LicenseTemplate.History")); - m_licenseTemplatePathChooser->addButton(tr("Edit..."), this, [this] { slotEdit(); }); + m_licenseTemplatePathChooser->addButton(Tr::tr("Edit..."), this, [this] { slotEdit(); }); setSettings(*m_settings); } @@ -404,11 +403,11 @@ void CppFileSettingsWidget::slotEdit() FilePath path = licenseTemplatePath(); if (path.isEmpty()) { // Pick a file name and write new template, edit with C++ - path = FileUtils::getSaveFilePath(this, tr("Choose Location for New License Template File")); + path = FileUtils::getSaveFilePath(this, Tr::tr("Choose Location for New License Template File")); if (path.isEmpty()) return; FileSaver saver(path, QIODevice::Text); - saver.write(tr(licenseTemplateTemplate).arg(Core::Constants::IDE_DISPLAY_NAME).toUtf8()); + saver.write(Tr::tr(licenseTemplateTemplate).arg(Core::Constants::IDE_DISPLAY_NAME).toUtf8()); if (!saver.finalize(this)) return; setLicenseTemplatePath(path); @@ -422,7 +421,7 @@ void CppFileSettingsWidget::slotEdit() CppFileSettingsPage::CppFileSettingsPage(CppFileSettings *settings) { setId(Constants::CPP_FILE_SETTINGS_ID); - setDisplayName(QCoreApplication::translate("CppEditor", Constants::CPP_FILE_SETTINGS_NAME)); + setDisplayName(Tr::tr("File Naming")); setCategory(Constants::CPP_SETTINGS_CATEGORY); setWidgetCreator([settings] { return new CppFileSettingsWidget(settings); }); } diff --git a/src/plugins/cppeditor/cppfindreferences.cpp b/src/plugins/cppeditor/cppfindreferences.cpp index e819e48f985..f6116f62d1a 100644 --- a/src/plugins/cppeditor/cppfindreferences.cpp +++ b/src/plugins/cppeditor/cppfindreferences.cpp @@ -5,6 +5,7 @@ #include "cppcodemodelsettings.h" #include "cppeditorconstants.h" +#include "cppeditortr.h" #include "cppmodelmanager.h" #include "cpptoolsreuse.h" #include "cppworkingcopy.h" @@ -55,13 +56,13 @@ QWidget *CppSearchResultFilter::createWidget() const auto widget = new QWidget; const auto layout = new QVBoxLayout(widget); layout->setContentsMargins(0, 0, 0, 0); - const auto readsCheckBox = new QCheckBox(Internal::CppFindReferences::tr("Reads")); + const auto readsCheckBox = new QCheckBox(Tr::tr("Reads")); readsCheckBox->setChecked(m_showReads); - const auto writesCheckBox = new QCheckBox(Internal::CppFindReferences::tr("Writes")); + const auto writesCheckBox = new QCheckBox(Tr::tr("Writes")); writesCheckBox->setChecked(m_showWrites); - const auto declsCheckBox = new QCheckBox(Internal::CppFindReferences::tr("Declarations")); + const auto declsCheckBox = new QCheckBox(Tr::tr("Declarations")); declsCheckBox->setChecked(m_showDecls); - const auto otherCheckBox = new QCheckBox(Internal::CppFindReferences::tr("Other")); + const auto otherCheckBox = new QCheckBox(Tr::tr("Other")); otherCheckBox->setChecked(m_showOther); layout->addWidget(readsCheckBox); layout->addWidget(writesCheckBox); @@ -376,7 +377,7 @@ void CppFindReferences::findUsages(CPlusPlus::Symbol *symbol, bool replace) { CPlusPlus::Overview overview; - SearchResult *search = SearchResultWindow::instance()->startNewSearch(tr("C++ Usages:"), + SearchResult *search = SearchResultWindow::instance()->startNewSearch(Tr::tr("C++ Usages:"), QString(), overview.prettyName(CPlusPlus::LookupContext::fullyQualifiedName(symbol)), replace ? SearchResultWindow::SearchAndReplace @@ -435,8 +436,8 @@ void CppFindReferences::findAll_helper(SearchResult *search, CPlusPlus::Symbol * workingCopy, context, symbol, categorize); createWatcher(result, search); - FutureProgress *progress = ProgressManager::addTask(result, tr("Searching for Usages"), - CppEditor::Constants::TASK_SEARCH); + FutureProgress *progress = ProgressManager::addTask(result, Tr::tr("Searching for Usages"), + CppEditor::Constants::TASK_SEARCH); connect(progress, &FutureProgress::clicked, search, &SearchResult::popup); } @@ -601,8 +602,8 @@ static void searchFinished(SearchResult *search, QFutureWatcher(search->additionalReplaceWidget()); if (renameCheckBox) { - renameCheckBox->setText(CppFindReferences::tr("Re&name %n files", nullptr, filesToRename.size())); - renameCheckBox->setToolTip(CppFindReferences::tr("Files:\n%1").arg(filesToRename.join('\n'))); + renameCheckBox->setText(Tr::tr("Re&name %n files", nullptr, filesToRename.size())); + renameCheckBox->setToolTip(Tr::tr("Files:\n%1").arg(filesToRename.join('\n'))); renameCheckBox->setVisible(true); } } @@ -727,7 +728,7 @@ void CppFindReferences::findMacroUses(const CPlusPlus::Macro ¯o, const QStri bool replace) { SearchResult *search = SearchResultWindow::instance()->startNewSearch( - tr("C++ Macro Usages:"), + Tr::tr("C++ Macro Usages:"), QString(), macro.nameToQString(), replace ? SearchResultWindow::SearchAndReplace @@ -769,8 +770,8 @@ void CppFindReferences::findMacroUses(const CPlusPlus::Macro ¯o, const QStri workingCopy, snapshot, macro); createWatcher(result, search); - FutureProgress *progress = ProgressManager::addTask(result, tr("Searching for Usages"), - CppEditor::Constants::TASK_SEARCH); + FutureProgress *progress = ProgressManager::addTask(result, Tr::tr("Searching for Usages"), + CppEditor::Constants::TASK_SEARCH); connect(progress, &FutureProgress::clicked, search, &SearchResult::popup); } diff --git a/src/plugins/cppeditor/cppfunctiondecldeflink.cpp b/src/plugins/cppeditor/cppfunctiondecldeflink.cpp index 0c94aadea0c..fa271108cf0 100644 --- a/src/plugins/cppeditor/cppfunctiondecldeflink.cpp +++ b/src/plugins/cppeditor/cppfunctiondecldeflink.cpp @@ -5,6 +5,7 @@ #include "cppcodestylesettings.h" #include "cppeditorconstants.h" +#include "cppeditortr.h" #include "cppeditorwidget.h" #include "cpplocalsymbols.h" #include "cppquickfixassistant.h" @@ -270,7 +271,7 @@ void FunctionDeclDefLink::apply(CppEditorWidget *editor, bool jumpToMatch) newTargetFile->apply(); } else { ToolTip::show(editor->toolTipPosition(linkSelection), - tr("Target file was changed, could not apply changes")); + Tr::tr("Target file was changed, could not apply changes")); } } @@ -305,9 +306,9 @@ void FunctionDeclDefLink::showMarker(CppEditorWidget *editor) QString message; if (targetDeclaration->asFunctionDefinition()) - message = tr("Apply changes to definition"); + message = Tr::tr("Apply changes to definition"); else - message = tr("Apply changes to declaration"); + message = Tr::tr("Apply changes to declaration"); Core::Command *quickfixCommand = Core::ActionManager::command(TextEditor::Constants::QUICKFIX_THIS); if (quickfixCommand) diff --git a/src/plugins/cppeditor/cppfunctiondecldeflink.h b/src/plugins/cppeditor/cppfunctiondecldeflink.h index 221cae113bc..5621e355aaf 100644 --- a/src/plugins/cppeditor/cppfunctiondecldeflink.h +++ b/src/plugins/cppeditor/cppfunctiondecldeflink.h @@ -43,7 +43,6 @@ private: class FunctionDeclDefLink { - Q_DECLARE_TR_FUNCTIONS(CppEditor::Internal::FunctionDeclDefLink) Q_DISABLE_COPY(FunctionDeclDefLink) FunctionDeclDefLink() = default; public: diff --git a/src/plugins/cppeditor/cppincludehierarchy.cpp b/src/plugins/cppeditor/cppincludehierarchy.cpp index 6d58bc4dd42..c2a9ead6b78 100644 --- a/src/plugins/cppeditor/cppincludehierarchy.cpp +++ b/src/plugins/cppeditor/cppincludehierarchy.cpp @@ -4,13 +4,14 @@ #include "cppincludehierarchy.h" #include "baseeditordocumentprocessor.h" -#include "editordocumenthandle.h" -#include "cppeditorwidget.h" #include "cppeditorconstants.h" #include "cppeditordocument.h" #include "cppeditorplugin.h" +#include "cppeditortr.h" +#include "cppeditorwidget.h" #include "cppelementevaluator.h" #include "cppmodelmanager.h" +#include "editordocumenthandle.h" #include #include @@ -160,9 +161,9 @@ QVariant CppIncludeHierarchyItem::data(int column, int role) const Q_UNUSED(column) if (role == Qt::DisplayRole) { if (isPhony() && childCount() == 0) - return QString(m_fileName + ' ' + CppIncludeHierarchyModel::tr("(none)")); + return QString(m_fileName + ' ' + Tr::tr("(none)")); if (m_isCyclic) - return QString(m_fileName + ' ' + CppIncludeHierarchyModel::tr("(cyclic)")); + return QString(m_fileName + ' ' + Tr::tr("(cyclic)")); return m_fileName; } @@ -224,9 +225,9 @@ void CppIncludeHierarchyModel::buildHierarchy(const FilePath &document) { m_editorFilePath = document; rootItem()->removeChildren(); - rootItem()->createChild(FilePath::fromPathPart(tr("Includes")), + rootItem()->createChild(FilePath::fromPathPart(Tr::tr("Includes")), CppIncludeHierarchyItem::InIncludes); - rootItem()->createChild(FilePath::fromPathPart(tr("Included by")), + rootItem()->createChild(FilePath::fromPathPart(Tr::tr("Included by")), CppIncludeHierarchyItem::InIncludedBy); } @@ -368,7 +369,7 @@ CppIncludeHierarchyWidget::CppIncludeHierarchyWidget() m_treeView->setItemDelegate(&m_delegate); connect(m_treeView, &QAbstractItemView::activated, this, &CppIncludeHierarchyWidget::onItemActivated); - m_includeHierarchyInfoLabel = new QLabel(tr("No include hierarchy available"), this); + m_includeHierarchyInfoLabel = new QLabel(Tr::tr("No include hierarchy available"), this); m_includeHierarchyInfoLabel->setAlignment(Qt::AlignCenter); m_includeHierarchyInfoLabel->setAutoFillBackground(true); m_includeHierarchyInfoLabel->setBackgroundRole(QPalette::Base); @@ -383,7 +384,7 @@ CppIncludeHierarchyWidget::CppIncludeHierarchyWidget() m_toggleSync = new QToolButton(this); m_toggleSync->setIcon(Utils::Icons::LINK_TOOLBAR.icon()); m_toggleSync->setCheckable(true); - m_toggleSync->setToolTip(tr("Synchronize with Editor")); + m_toggleSync->setToolTip(Tr::tr("Synchronize with Editor")); connect(m_toggleSync, &QToolButton::clicked, this, &CppIncludeHierarchyWidget::syncFromEditorManager); @@ -496,7 +497,7 @@ void CppIncludeHierarchyWidget::syncFromEditorManager() CppIncludeHierarchyFactory::CppIncludeHierarchyFactory() { - setDisplayName(tr("Include Hierarchy")); + setDisplayName(Tr::tr("Include Hierarchy")); setPriority(800); setId(Constants::INCLUDE_HIERARCHY_ID); } diff --git a/src/plugins/cppeditor/cppincludesfilter.cpp b/src/plugins/cppeditor/cppincludesfilter.cpp index f3a90374927..a59a7c90f16 100644 --- a/src/plugins/cppeditor/cppincludesfilter.cpp +++ b/src/plugins/cppeditor/cppincludesfilter.cpp @@ -4,6 +4,7 @@ #include "cppincludesfilter.h" #include "cppeditorconstants.h" +#include "cppeditortr.h" #include "cppmodelmanager.h" #include @@ -98,9 +99,9 @@ CppIncludesFilter::CppIncludesFilter() setId(Constants::INCLUDES_FILTER_ID); setDisplayName(Constants::INCLUDES_FILTER_DISPLAY_NAME); setDescription( - tr("Matches all files that are included by all C++ files in all projects. Append " - "\"+\" or \":\" to jump to the given line number. Append another " - "\"+\" or \":\" to jump to the column number as well.")); + Tr::tr("Matches all files that are included by all C++ files in all projects. Append " + "\"+\" or \":\" to jump to the given line number. Append another " + "\"+\" or \":\" to jump to the column number as well.")); setDefaultShortcutString("ai"); setDefaultIncludedByDefault(true); setPriority(ILocatorFilter::Low); diff --git a/src/plugins/cppeditor/cppincludesfilter.h b/src/plugins/cppeditor/cppincludesfilter.h index dddb9911cd4..6ae5dbb91c4 100644 --- a/src/plugins/cppeditor/cppincludesfilter.h +++ b/src/plugins/cppeditor/cppincludesfilter.h @@ -9,8 +9,6 @@ namespace CppEditor::Internal { class CppIncludesFilter : public Core::BaseFileFilter { - Q_OBJECT - public: CppIncludesFilter(); diff --git a/src/plugins/cppeditor/cppindexingsupport.cpp b/src/plugins/cppeditor/cppindexingsupport.cpp index bef033d1362..2d0e2b55194 100644 --- a/src/plugins/cppeditor/cppindexingsupport.cpp +++ b/src/plugins/cppeditor/cppindexingsupport.cpp @@ -6,6 +6,7 @@ #include "builtineditordocumentparser.h" #include "cppchecksymbols.h" #include "cppeditorconstants.h" +#include "cppeditortr.h" #include "cppsourceprocessor.h" #include "searchsymbols.h" @@ -328,7 +329,7 @@ QFuture CppIndexingSupport::refreshSourceFiles(const QSet &source m_synchronizer.addFuture(result); if (mode == CppModelManager::ForcedProgressNotification || sourceFiles.count() > 1) { - Core::ProgressManager::addTask(result, QCoreApplication::translate("CppEditor::Internal::BuiltinIndexingSupport", "Parsing C/C++ Files"), + Core::ProgressManager::addTask(result, Tr::tr("Parsing C/C++ Files"), CppEditor::Constants::TASK_INDEX); } diff --git a/src/plugins/cppeditor/cppinsertvirtualmethods.cpp b/src/plugins/cppeditor/cppinsertvirtualmethods.cpp index 7f07dbfc410..eabd00c2f1c 100644 --- a/src/plugins/cppeditor/cppinsertvirtualmethods.cpp +++ b/src/plugins/cppeditor/cppinsertvirtualmethods.cpp @@ -4,6 +4,7 @@ #include "cppinsertvirtualmethods.h" #include "cppcodestylesettings.h" +#include "cppeditortr.h" #include "cppquickfixassistant.h" #include "cpptoolsreuse.h" #include "functionutils.h" @@ -509,8 +510,7 @@ public: : CppQuickFixOperation(interface, 0) , m_factory(factory) { - setDescription(QCoreApplication::translate( - "CppEditor::QuickFix", "Insert Virtual Functions of Base Classes")); + setDescription(Tr::tr("Insert Virtual Functions of Base Classes")); const QList &path = interface.path(); const int pathSize = path.size(); @@ -1008,35 +1008,35 @@ void InsertVirtualMethodsDialog::initGui() if (m_view) return; - setWindowTitle(tr("Insert Virtual Functions")); + setWindowTitle(Tr::tr("Insert Virtual Functions")); auto globalVerticalLayout = new QVBoxLayout; // View - QGroupBox *groupBoxView = new QGroupBox(tr("&Functions to insert:"), this); + QGroupBox *groupBoxView = new QGroupBox(Tr::tr("&Functions to insert:"), this); auto groupBoxViewLayout = new QVBoxLayout(groupBoxView); m_filter = new QLineEdit(this); m_filter->setClearButtonEnabled(true); - m_filter->setPlaceholderText(tr("Filter")); + m_filter->setPlaceholderText(Tr::tr("Filter")); groupBoxViewLayout->addWidget(m_filter); m_view = new QTreeView(this); m_view->setEditTriggers(QAbstractItemView::NoEditTriggers); m_view->setHeaderHidden(true); groupBoxViewLayout->addWidget(m_view); m_hideReimplementedFunctions = - new QCheckBox(tr("&Hide reimplemented functions"), this); + new QCheckBox(Tr::tr("&Hide reimplemented functions"), this); groupBoxViewLayout->addWidget(m_hideReimplementedFunctions); // Insertion options - QGroupBox *groupBoxImplementation = new QGroupBox(tr("&Insertion options:"), this); + QGroupBox *groupBoxImplementation = new QGroupBox(Tr::tr("&Insertion options:"), this); auto groupBoxImplementationLayout = new QVBoxLayout(groupBoxImplementation); m_insertMode = new QComboBox(this); - m_insertMode->addItem(tr("Insert only declarations"), ModeOnlyDeclarations); - m_insertMode->addItem(tr("Insert definitions inside class"), ModeInsideClass); - m_insertMode->addItem(tr("Insert definitions outside class"), ModeOutsideClass); - m_insertMode->addItem(tr("Insert definitions in implementation file"), ModeImplementationFile); - m_virtualKeyword = new QCheckBox(tr("Add \"&virtual\" to function declaration"), this); + m_insertMode->addItem(Tr::tr("Insert only declarations"), ModeOnlyDeclarations); + m_insertMode->addItem(Tr::tr("Insert definitions inside class"), ModeInsideClass); + m_insertMode->addItem(Tr::tr("Insert definitions outside class"), ModeOutsideClass); + m_insertMode->addItem(Tr::tr("Insert definitions in implementation file"), ModeImplementationFile); + m_virtualKeyword = new QCheckBox(Tr::tr("Add \"&virtual\" to function declaration"), this); m_overrideReplacementCheckBox = new QCheckBox( - tr("Add \"override\" equivalent to function declaration:"), this); + Tr::tr("Add \"override\" equivalent to function declaration:"), this); m_overrideReplacementComboBox = new QComboBox(this); QSizePolicy sizePolicy = m_overrideReplacementComboBox->sizePolicy(); sizePolicy.setHorizontalPolicy(QSizePolicy::Expanding); @@ -1047,7 +1047,7 @@ void InsertVirtualMethodsDialog::initGui() auto clearUserAddedReplacements = new QAction(this); clearUserAddedReplacements->setIcon(Utils::Icons::CLEAN_TOOLBAR.icon()); - clearUserAddedReplacements->setText(tr("Clear Added \"override\" Equivalents")); + clearUserAddedReplacements->setText(Tr::tr("Clear Added \"override\" Equivalents")); connect(clearUserAddedReplacements, &QAction::triggered, [this] { m_availableOverrideReplacements = defaultOverrideReplacements(); updateOverrideReplacementsComboBox(); @@ -1116,7 +1116,7 @@ void InsertVirtualMethodsDialog::initData() if (m_hasImplementationFile) { if (m_insertMode->count() == 3) { - m_insertMode->addItem(tr("Insert definitions in implementation file"), + m_insertMode->addItem(Tr::tr("Insert definitions in implementation file"), ModeImplementationFile); } } else { diff --git a/src/plugins/cppeditor/cppmodelmanager.cpp b/src/plugins/cppeditor/cppmodelmanager.cpp index 46843defcb4..c80abecbacc 100644 --- a/src/plugins/cppeditor/cppmodelmanager.cpp +++ b/src/plugins/cppeditor/cppmodelmanager.cpp @@ -537,7 +537,7 @@ void CppModelManager::findUnusedFunctions(const FilePath &folder) QTC_ASSERT(functionsFilter, return); const QPointer search = Core::SearchResultWindow::instance() - ->startNewSearch(tr("Find Unused Functions"), + ->startNewSearch(Tr::tr("Find Unused Functions"), {}, {}, Core::SearchResultWindow::SearchOnly, @@ -1253,9 +1253,8 @@ static QSet filteredFilesRemoved(const QSet &files, int fileSi for (const QRegularExpression &rx: std::as_const(regexes)) { QRegularExpressionMatch match = rx.match(filePath.absoluteFilePath().path()); if (match.hasMatch()) { - const QString msg = QCoreApplication::translate( - "CppIndexer", - "C++ Indexer: Skipping file \"%1\" because its path matches the ignore pattern.") + const QString msg = Tr::tr("C++ Indexer: Skipping file \"%1\" " + "because its path matches the ignore pattern.") .arg(filePath.displayName()); QMetaObject::invokeMethod(Core::MessageManager::instance(), [msg]() { Core::MessageManager::writeSilently(msg); }); diff --git a/src/plugins/cppeditor/cppoutline.cpp b/src/plugins/cppeditor/cppoutline.cpp index d1be6a280b4..8c28c7e30a6 100644 --- a/src/plugins/cppeditor/cppoutline.cpp +++ b/src/plugins/cppeditor/cppoutline.cpp @@ -3,8 +3,9 @@ #include "cppoutline.h" -#include "cppeditoroutline.h" #include "cppeditordocument.h" +#include "cppeditoroutline.h" +#include "cppeditortr.h" #include "cppmodelmanager.h" #include "cppoutlinemodel.h" @@ -37,9 +38,9 @@ void CppOutlineTreeView::contextMenuEvent(QContextMenuEvent *event) QMenu contextMenu; - QAction *action = contextMenu.addAction(tr("Expand All")); + QAction *action = contextMenu.addAction(Tr::tr("Expand All")); connect(action, &QAction::triggered, this, &QTreeView::expandAll); - action = contextMenu.addAction(tr("Collapse All")); + action = contextMenu.addAction(Tr::tr("Collapse All")); connect(action, &QAction::triggered, this, &QTreeView::collapseAll); contextMenu.exec(event->globalPos()); diff --git a/src/plugins/cppeditor/cppoutlinemodel.cpp b/src/plugins/cppeditor/cppoutlinemodel.cpp index efbd80d1d6a..bbf3610ebf4 100644 --- a/src/plugins/cppeditor/cppoutlinemodel.cpp +++ b/src/plugins/cppeditor/cppoutlinemodel.cpp @@ -31,8 +31,8 @@ public: switch (role) { case Qt::DisplayRole: if (parent()->childCount() > 1) - return QString(QT_TRANSLATE_NOOP("CppEditor::OverviewModel", "")); + return QString(QT_TRANSLATE_NOOP("CppEditor", "")); default: return QVariant(); } diff --git a/src/plugins/cppeditor/cppparsecontext.cpp b/src/plugins/cppeditor/cppparsecontext.cpp index bf24861a091..554c6ca8390 100644 --- a/src/plugins/cppeditor/cppparsecontext.cpp +++ b/src/plugins/cppeditor/cppparsecontext.cpp @@ -3,6 +3,7 @@ #include "cppparsecontext.h" +#include "cppeditortr.h" #include "cppeditorwidget.h" #include @@ -30,12 +31,12 @@ QString ParseContextModel::currentToolTip() const if (!index.isValid()) return QString(); - return tr("

Active Parse Context:
%1

" - "

Multiple parse contexts (set of defines, include paths, and so on) " - "are available for this file.

" - "

Choose a parse context to set it as the preferred one. " - "Clear the preference from the context menu.

") - .arg(data(index, Qt::ToolTipRole).toString()); + return Tr::tr("

Active Parse Context:
%1

" + "

Multiple parse contexts (set of defines, include paths, and so on) " + "are available for this file.

" + "

Choose a parse context to set it as the preferred one. " + "Clear the preference from the context menu.

") + .arg(data(index, Qt::ToolTipRole).toString()); } void ParseContextModel::setPreferred(int index) @@ -120,7 +121,7 @@ ParseContextWidget::ParseContextWidget(ParseContextModel &parseContextModel, QWi setSizePolicy(policy); // Set up context menu with a clear action setContextMenuPolicy(Qt::ActionsContextMenu); - m_clearPreferredAction = new QAction(tr("Clear Preferred Parse Context"), this); + m_clearPreferredAction = new QAction(Tr::tr("Clear Preferred Parse Context"), this); connect(m_clearPreferredAction, &QAction::triggered, this, [this] { m_parseContextModel.clearPreferred(); }); diff --git a/src/plugins/cppeditor/cpppreprocessordialog.cpp b/src/plugins/cppeditor/cpppreprocessordialog.cpp index 837f2cbdef9..b6b1d9d2a63 100644 --- a/src/plugins/cppeditor/cpppreprocessordialog.cpp +++ b/src/plugins/cppeditor/cpppreprocessordialog.cpp @@ -4,6 +4,7 @@ #include "cpppreprocessordialog.h" #include "cppeditorconstants.h" +#include "cppeditortr.h" #include "cpptoolsreuse.h" #include @@ -23,7 +24,7 @@ CppPreProcessorDialog::CppPreProcessorDialog(const FilePath &filePath, QWidget * , m_filePath(filePath) { resize(400, 300); - setWindowTitle(tr("Additional C++ Preprocessor Directives")); + setWindowTitle(Tr::tr("Additional C++ Preprocessor Directives")); const QString key = Constants::EXTRA_PREPROCESSOR_DIRECTIVES + m_filePath.toString(); const QString directives = ProjectExplorer::SessionManager::value(key).toString(); @@ -38,7 +39,7 @@ CppPreProcessorDialog::CppPreProcessorDialog(const FilePath &filePath, QWidget * using namespace Layouting; Column { - tr("Additional C++ Preprocessor Directives for %1:").arg(m_filePath.fileName()), + Tr::tr("Additional C++ Preprocessor Directives for %1:").arg(m_filePath.fileName()), m_editWidget, buttonBox, }.attachTo(this); diff --git a/src/plugins/cppeditor/cppprojectinfogenerator.cpp b/src/plugins/cppeditor/cppprojectinfogenerator.cpp index 29ec0f4c93a..fe077bd3771 100644 --- a/src/plugins/cppeditor/cppprojectinfogenerator.cpp +++ b/src/plugins/cppeditor/cppprojectinfogenerator.cpp @@ -3,6 +3,7 @@ #include "cppprojectinfogenerator.h" +#include "cppeditortr.h" #include "cppprojectfilecategorizer.h" #include @@ -47,12 +48,12 @@ ProjectInfo::ConstPtr ProjectInfoGenerator::generate() }); }; if (m_cToolchainMissing) { - showWarning(QCoreApplication::translate("CppEditor", + showWarning(Tr::tr( "The project contains C source files, but the currently active kit " "has no C compiler. The code model will not be fully functional.")); } if (m_cxxToolchainMissing) { - showWarning(QCoreApplication::translate("CppEditor", + showWarning(Tr::tr( "The project contains C++ source files, but the currently active kit " "has no C++ compiler. The code model will not be fully functional.")); } diff --git a/src/plugins/cppeditor/cppprojectupdater.cpp b/src/plugins/cppeditor/cppprojectupdater.cpp index 4868077940a..91bcd943b12 100644 --- a/src/plugins/cppeditor/cppprojectupdater.cpp +++ b/src/plugins/cppeditor/cppprojectupdater.cpp @@ -3,6 +3,7 @@ #include "cppprojectupdater.h" +#include "cppeditortr.h" #include "cppmodelmanager.h" #include "cppprojectinfogenerator.h" #include "generatedcodemodelsupport.h" @@ -102,7 +103,7 @@ void CppProjectUpdater::update(const ProjectUpdateInfo &projectUpdateInfo, }; m_taskTree.reset(new TaskTree(root)); auto progress = new Core::TaskProgress(m_taskTree.get()); - progress->setDisplayName(tr("Preparing C++ Code Model")); + progress->setDisplayName(Tr::tr("Preparing C++ Code Model")); m_taskTree->start(); } diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 1025e278042..da2bf677f10 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -6,6 +6,7 @@ #include "baseeditordocumentprocessor.h" #include "cppcodestylesettings.h" #include "cppeditordocument.h" +#include "cppeditortr.h" #include "cppeditorwidget.h" #include "cppfunctiondecldeflink.h" #include "cppinsertvirtualmethods.h" @@ -332,7 +333,7 @@ public: QString description() const override { - return QApplication::translate("CppEditor::QuickFix", "Rewrite Using %1").arg(replacement); + return Tr::tr("Rewrite Using %1").arg(replacement); } void perform() override @@ -424,9 +425,9 @@ public: QString description() const override { if (replacement.isEmpty()) - return QApplication::translate("CppEditor::QuickFix", "Swap Operands"); + return Tr::tr("Swap Operands"); else - return QApplication::translate("CppEditor::QuickFix", "Rewrite Using %1").arg(replacement); + return Tr::tr("Rewrite Using %1").arg(replacement); } void perform() override @@ -567,8 +568,7 @@ void RewriteLogicalAnd::match(const CppQuickFixInterface &interface, QuickFixOpe file->tokenAt(op->pattern->binary_op_token).is(T_AMPER_AMPER) && file->tokenAt(op->left->unary_op_token).is(T_EXCLAIM) && file->tokenAt(op->right->unary_op_token).is(T_EXCLAIM)) { - op->setDescription(QApplication::translate("CppEditor::QuickFix", - "Rewrite Condition Using ||")); + op->setDescription(Tr::tr("Rewrite Condition Using ||")); op->setPriority(index); result.append(op); } @@ -601,8 +601,7 @@ public: : CppQuickFixOperation(interface, priority) , declaration(decl) { - setDescription(QApplication::translate("CppEditor::QuickFix", - "Split Declaration")); + setDescription(Tr::tr("Split Declaration")); } void perform() override @@ -693,7 +692,7 @@ public: : CppQuickFixOperation(interface, priority) , _statement(statement) { - setDescription(QApplication::translate("CppEditor::QuickFix", "Add Curly Braces")); + setDescription(Tr::tr("Add Curly Braces")); } void perform() override @@ -759,8 +758,7 @@ public: MoveDeclarationOutOfIfOp(const CppQuickFixInterface &interface) : CppQuickFixOperation(interface) { - setDescription(QApplication::translate("CppEditor::QuickFix", - "Move Declaration out of Condition")); + setDescription(Tr::tr("Move Declaration out of Condition")); reset(); } @@ -834,8 +832,7 @@ public: MoveDeclarationOutOfWhileOp(const CppQuickFixInterface &interface) : CppQuickFixOperation(interface) { - setDescription(QApplication::translate("CppEditor::QuickFix", - "Move Declaration out of Condition")); + setDescription(Tr::tr("Move Declaration out of Condition")); reset(); } @@ -920,8 +917,7 @@ public: , pattern(pattern) , condition(condition) { - setDescription(QApplication::translate("CppEditor::QuickFix", - "Split if Statement")); + setDescription(Tr::tr("Split if Statement")); } void perform() override @@ -1085,7 +1081,7 @@ static QByteArray charToStringEscapeSequences(const QByteArray &content) static QString msgQtStringLiteralDescription(const QString &replacement) { - return QApplication::translate("CppEditor::QuickFix", "Enclose in %1(...)").arg(replacement); + return Tr::tr("Enclose in %1(...)").arg(replacement); } static QString stringLiteralReplacement(unsigned actions) @@ -1256,8 +1252,7 @@ void WrapStringLiteral::match(const CppQuickFixInterface &interface, QuickFixOpe const QByteArray contents(file->tokenAt(charLiteral->literal_token).identifier->chars()); if (!charToStringEscapeSequences(contents).isEmpty()) { actions = DoubleQuoteAction | ConvertEscapeSequencesToStringAction; - description = QApplication::translate("CppEditor::QuickFix", - "Convert to String Literal"); + description = Tr::tr("Convert to String Literal"); result << new WrapStringLiteralOp(interface, priority, actions, description, literal); } @@ -1271,13 +1266,12 @@ void WrapStringLiteral::match(const CppQuickFixInterface &interface, QuickFixOpe if (!stringToCharEscapeSequences(contents).isEmpty()) { actions = EncloseInQLatin1CharAction | SingleQuoteAction | ConvertEscapeSequencesToCharAction | objectiveCActions; - QString description = QApplication::translate("CppEditor::QuickFix", - "Convert to Character Literal and Enclose in QLatin1Char(...)"); + QString description = + Tr::tr("Convert to Character Literal and Enclose in QLatin1Char(...)"); result << new WrapStringLiteralOp(interface, priority, actions, description, literal); actions &= ~EncloseInQLatin1CharAction; - description = QApplication::translate("CppEditor::QuickFix", - "Convert to Character Literal"); + description = Tr::tr("Convert to Character Literal"); result << new WrapStringLiteralOp(interface, priority, actions, description, literal); } @@ -1310,7 +1304,7 @@ void TranslateStringLiteral::match(const CppQuickFixInterface &interface, const Name *trName = control->identifier("tr"); // Check whether we are in a function: - const QString description = QApplication::translate("CppEditor::QuickFix", "Mark as Translatable"); + const QString description = Tr::tr("Mark as Translatable"); for (int i = path.size() - 1; i >= 0; --i) { if (FunctionDefinitionAST *definition = path.at(i)->asFunctionDefinition()) { Function *function = definition->symbol; @@ -1365,8 +1359,7 @@ public: , stringLiteral(stringLiteral) , qlatin1Call(qlatin1Call) { - setDescription(QApplication::translate("CppEditor::QuickFix", - "Convert to Objective-C String Literal")); + setDescription(Tr::tr("Convert to Objective-C String Literal")); } void perform() override @@ -1510,7 +1503,7 @@ void ConvertNumericLiteral::match(const CppQuickFixInterface &interface, QuickFi */ const QString replacement = QString::asprintf("0x%lX", value); auto op = new ConvertNumericLiteralOp(interface, start, start + numberLength, replacement); - op->setDescription(QApplication::translate("CppEditor::QuickFix", "Convert to Hexadecimal")); + op->setDescription(Tr::tr("Convert to Hexadecimal")); op->setPriority(priority); result << op; } @@ -1527,7 +1520,7 @@ void ConvertNumericLiteral::match(const CppQuickFixInterface &interface, QuickFi */ const QString replacement = QString::asprintf("0%lo", value); auto op = new ConvertNumericLiteralOp(interface, start, start + numberLength, replacement); - op->setDescription(QApplication::translate("CppEditor::QuickFix", "Convert to Octal")); + op->setDescription(Tr::tr("Convert to Octal")); op->setPriority(priority); result << op; } @@ -1544,7 +1537,7 @@ void ConvertNumericLiteral::match(const CppQuickFixInterface &interface, QuickFi */ const QString replacement = QString::asprintf("%lu", value); auto op = new ConvertNumericLiteralOp(interface, start, start + numberLength, replacement); - op->setDescription(QApplication::translate("CppEditor::QuickFix", "Convert to Decimal")); + op->setDescription(Tr::tr("Convert to Decimal")); op->setPriority(priority); result << op; } @@ -1568,7 +1561,7 @@ void ConvertNumericLiteral::match(const CppQuickFixInterface &interface, QuickFi replacement.append(QString::fromStdString(b.to_string()).remove(re)); } auto op = new ConvertNumericLiteralOp(interface, start, start + numberLength, replacement); - op->setDescription(QApplication::translate("CppEditor::QuickFix", "Convert to Binary")); + op->setDescription(Tr::tr("Convert to Binary")); op->setPriority(priority); result << op; } @@ -1587,7 +1580,7 @@ public: , binaryAST(binaryAST) , simpleNameAST(simpleNameAST) { - setDescription(QApplication::translate("CppEditor::QuickFix", "Add Local Declaration")); + setDescription(Tr::tr("Add Local Declaration")); } void perform() override @@ -1701,7 +1694,7 @@ public: , m_isAllUpper(name.isUpper()) , m_test(test) { - setDescription(QApplication::translate("CppEditor::QuickFix", "Convert to Camel Case")); + setDescription(Tr::tr("Convert to Camel Case")); } void perform() override @@ -1783,7 +1776,7 @@ AddIncludeForUndefinedIdentifierOp::AddIncludeForUndefinedIdentifierOp( : CppQuickFixOperation(interface, priority) , m_include(include) { - setDescription(QApplication::translate("CppEditor::QuickFix", "Add #include %1").arg(m_include)); + setDescription(Tr::tr("Add #include %1").arg(m_include)); } void AddIncludeForUndefinedIdentifierOp::perform() @@ -1801,8 +1794,7 @@ AddForwardDeclForUndefinedIdentifierOp::AddForwardDeclForUndefinedIdentifierOp( int symbolPos) : CppQuickFixOperation(interface, priority), m_className(fqClassName), m_symbolPos(symbolPos) { - setDescription(QApplication::translate("CppEditor::QuickFix", - "Add forward declaration for %1").arg(m_className)); + setDescription(Tr::tr("Add forward declaration for %1").arg(m_className)); } void AddForwardDeclForUndefinedIdentifierOp::perform() @@ -2056,7 +2048,7 @@ void AddIncludeForUndefinedIdentifier::match(const CppQuickFixInterface &interfa QList matches; const QString currentDocumentFilePath = interface.semanticInfo().doc->filePath().toString(); const ProjectExplorer::HeaderPaths headerPaths = relevantHeaderPaths(currentDocumentFilePath); - QList headers; + FilePaths headers; // Find an include file through the locator if (matchName(nameAst->name, &matches, &className)) { @@ -2149,11 +2141,9 @@ public: { QString targetString; if (target == TargetPrevious) - targetString = QApplication::translate("CppEditor::QuickFix", - "Switch with Previous Parameter"); + targetString = Tr::tr("Switch with Previous Parameter"); else - targetString = QApplication::translate("CppEditor::QuickFix", - "Switch with Next Parameter"); + targetString = Tr::tr("Switch with Next Parameter"); setDescription(targetString); } @@ -2228,11 +2218,10 @@ public: { QString description; if (m_change.operationList().size() == 1) { - description = QApplication::translate("CppEditor::QuickFix", + description = Tr::tr( "Reformat to \"%1\"").arg(m_change.operationList().constFirst().text); } else { // > 1 - description = QApplication::translate("CppEditor::QuickFix", - "Reformat Pointers or References"); + description = Tr::tr("Reformat Pointers or References"); } setDescription(description); } @@ -2395,8 +2384,7 @@ public: , compoundStatement(compoundStatement) , values(values) { - setDescription(QApplication::translate("CppEditor::QuickFix", - "Complete Switch Statement")); + setDescription(Tr::tr("Complete Switch Statement")); } void perform() override @@ -2533,8 +2521,7 @@ public: , m_xsSpec(xsSpec) , m_decl(decl) { - setDescription(QCoreApplication::translate("CppEditor::InsertDeclOperation", - "Add %1 Declaration") + setDescription(Tr::tr("Add %1 Declaration") .arg(InsertionPointLocator::accessSpecToString(xsSpec))); } @@ -2696,19 +2683,14 @@ public: const FilePath targetFile = m_loc.isValid() ? m_loc.filePath() : m_targetFilePath; const FilePath resolved = targetFile.relativePathFrom(declFile.parentDir()); setPriority(2); - setDescription(QCoreApplication::translate("CppEditor::InsertDefOperation", - "Add Definition in %1") - .arg(resolved.displayName())); + setDescription(Tr::tr("Add Definition in %1").arg(resolved.displayName())); } else if (freeFunction) { - setDescription(QCoreApplication::translate("CppEditor::InsertDefOperation", - "Add Definition Here")); + setDescription(Tr::tr("Add Definition Here")); } else if (m_defpos == DefPosInsideClass) { - setDescription(QCoreApplication::translate("CppEditor::InsertDefOperation", - "Add Definition Inside Class")); + setDescription(Tr::tr("Add Definition Inside Class")); } else if (m_defpos == DefPosOutsideClass) { setPriority(1); - setDescription(QCoreApplication::translate("CppEditor::InsertDefOperation", - "Add Definition Outside Class")); + setDescription(Tr::tr("Add Definition Outside Class")); } } @@ -2959,8 +2941,7 @@ public: const QString &type) : CppQuickFixOperation(interface), m_class(theClass), m_member(member), m_type(type) { - setDescription(QCoreApplication::translate("CppEditor::Quickfix", - "Add Class Member \"%1\"").arg(m_member)); + setDescription(Tr::tr("Add Class Member \"%1\"").arg(m_member)); } private: @@ -2970,8 +2951,8 @@ private: if (type.isEmpty()) { type = QInputDialog::getText( Core::ICore::dialogParent(), - QCoreApplication::translate("CppEditor::Quickfix","Provide the type"), - QCoreApplication::translate("CppEditor::Quickfix","Data type:"), + Tr::tr("Provide the type"), + Tr::tr("Data type:"), QLineEdit::Normal); } if (type.isEmpty()) @@ -3101,15 +3082,14 @@ using MemberFunctionImplSettings = QList; class AddImplementationsDialog : public QDialog { - Q_DECLARE_TR_FUNCTIONS(AddImplementationsDialog) public: - AddImplementationsDialog(const QList &candidates, const Utils::FilePath &implFile) + AddImplementationsDialog(const QList &candidates, const FilePath &implFile) : QDialog(Core::ICore::dialogParent()), m_candidates(candidates) { - setWindowTitle(tr("Member Function Implementations")); + setWindowTitle(Tr::tr("Member Function Implementations")); const auto defaultImplTargetComboBox = new QComboBox; - QStringList implTargetStrings{tr("None"), tr("Inline"), tr("Outside Class")}; + QStringList implTargetStrings{Tr::tr("None"), Tr::tr("Inline"), Tr::tr("Outside Class")}; if (!implFile.isEmpty()) implTargetStrings.append(implFile.fileName()); defaultImplTargetComboBox->insertItems(0, implTargetStrings); @@ -3121,7 +3101,7 @@ public: } }); const auto defaultImplTargetLayout = new QHBoxLayout; - defaultImplTargetLayout->addWidget(new QLabel(tr("Default implementation location:"))); + defaultImplTargetLayout->addWidget(new QLabel(Tr::tr("Default implementation location:"))); defaultImplTargetLayout->addWidget(defaultImplTargetComboBox); const auto candidatesLayout = new QGridLayout; @@ -3149,7 +3129,7 @@ public: defaultImplTargetComboBox->setCurrentIndex(implTargetStrings.size() - 1); const auto mainLayout = new QVBoxLayout(this); mainLayout->addLayout(defaultImplTargetLayout); - mainLayout->addWidget(Utils::Layouting::createHr(this)); + mainLayout->addWidget(Layouting::createHr(this)); mainLayout->addLayout(candidatesLayout); mainLayout->addWidget(buttonBox); } @@ -3182,7 +3162,7 @@ public: InsertDefsOperation(const CppQuickFixInterface &interface) : CppQuickFixOperation(interface) { - setDescription(CppQuickFixFactory::tr("Create Implementations for Member Functions")); + setDescription(Tr::tr("Create Implementations for Member Functions")); m_classAST = astForClassOperations(interface); if (!m_classAST) @@ -3742,38 +3722,37 @@ public: // of the enum 'GenerateFlag' int p = 0; if (possibleFlags & HaveExistingQProperty) { - const auto desc = CppQuickFixFactory::tr("Generate Missing Q_PROPERTY Members"); + const QString desc = Tr::tr("Generate Missing Q_PROPERTY Members"); results << new GenerateGetterSetterOp(interface, data, possibleFlags, ++p, desc); } else { if (possibleFlags & GenerateSetter) { - const auto desc = CppQuickFixFactory::tr("Generate Setter"); + const QString desc = Tr::tr("Generate Setter"); results << new GenerateGetterSetterOp(interface, data, GenerateSetter, ++p, desc); } if (possibleFlags & GenerateGetter) { - const auto desc = CppQuickFixFactory::tr("Generate Getter"); + const QString desc = Tr::tr("Generate Getter"); results << new GenerateGetterSetterOp(interface, data, GenerateGetter, ++p, desc); } if (possibleFlags & GenerateGetter && possibleFlags & GenerateSetter) { - const auto desc = CppQuickFixFactory::tr("Generate Getter and Setter"); - const auto flags = GenerateGetter | GenerateSetter; + const QString desc = Tr::tr("Generate Getter and Setter"); + const int flags = GenerateGetter | GenerateSetter; results << new GenerateGetterSetterOp(interface, data, flags, ++p, desc); } if (possibleFlags & GenerateConstantProperty) { - const auto desc = CppQuickFixFactory::tr( - "Generate Constant Q_PROPERTY and Missing Members"); - const auto flags = possibleFlags & ~(GenerateSetter | GenerateSignal | GenerateReset); + const QString desc = Tr::tr("Generate Constant Q_PROPERTY and Missing Members"); + const int flags = possibleFlags & ~(GenerateSetter | GenerateSignal | GenerateReset); results << new GenerateGetterSetterOp(interface, data, flags, ++p, desc); } if (possibleFlags & GenerateProperty) { if (possibleFlags & GenerateReset) { - const auto desc = CppQuickFixFactory::tr( + const QString desc = Tr::tr( "Generate Q_PROPERTY and Missing Members with Reset Function"); - const auto flags = possibleFlags & ~GenerateConstantProperty; + const int flags = possibleFlags & ~GenerateConstantProperty; results << new GenerateGetterSetterOp(interface, data, flags, ++p, desc); } - const auto desc = CppQuickFixFactory::tr("Generate Q_PROPERTY and Missing Members"); - const auto flags = possibleFlags & ~GenerateConstantProperty & ~GenerateReset; + const QString desc = Tr::tr("Generate Q_PROPERTY and Missing Members"); + const int flags = possibleFlags & ~GenerateConstantProperty & ~GenerateReset; results << new GenerateGetterSetterOp(interface, data, flags, ++p, desc); } } @@ -4402,7 +4381,7 @@ public: }; using GetterSetterCandidates = std::vector; -class CandidateTreeItem : public Utils::TreeItem +class CandidateTreeItem : public TreeItem { public: enum Column { @@ -4499,8 +4478,6 @@ private: class GenerateGettersSettersDialog : public QDialog { - Q_DECLARE_TR_FUNCTIONS(GenerateGettersSettersDialog) - static constexpr CandidateTreeItem::Column CheckBoxColumn[4] = {CandidateTreeItem::Column::GetterColumn, CandidateTreeItem::Column::SetterColumn, @@ -4513,20 +4490,20 @@ public: , m_candidates(candidates) { using Flags = GenerateGetterSetterOp::GenerateFlag; - setWindowTitle(tr("Getters and Setters")); - const auto model = new Utils::TreeModel(this); + setWindowTitle(Tr::tr("Getters and Setters")); + const auto model = new TreeModel(this); model->setHeader(QStringList({ - tr("Member"), - tr("Getter"), - tr("Setter"), - tr("Signal"), - tr("Reset"), - tr("QProperty"), - tr("Constant QProperty"), + Tr::tr("Member"), + Tr::tr("Getter"), + Tr::tr("Setter"), + Tr::tr("Signal"), + Tr::tr("Reset"), + Tr::tr("QProperty"), + Tr::tr("Constant QProperty"), })); for (MemberInfo &candidate : m_candidates) model->rootItem()->appendChild(new CandidateTreeItem(&candidate)); - const auto view = new Utils::BaseTreeView(this); + const auto view = new BaseTreeView(this); view->setModel(model); int optimalWidth = 0; for (int i = 0; i < model->columnCount(QModelIndex{}); ++i) { @@ -4566,13 +4543,13 @@ public: })) { const Column column = CheckBoxColumn[i]; if (column == Column::GetterColumn) - checkBoxes[i] = new QCheckBox(tr("Create getters for all members")); + checkBoxes[i] = new QCheckBox(Tr::tr("Create getters for all members")); else if (column == Column::SetterColumn) - checkBoxes[i] = new QCheckBox(tr("Create setters for all members")); + checkBoxes[i] = new QCheckBox(Tr::tr("Create setters for all members")); else if (column == Column::SignalColumn) - checkBoxes[i] = new QCheckBox(tr("Create signals for all members")); + checkBoxes[i] = new QCheckBox(Tr::tr("Create signals for all members")); else if (column == Column::QPropertyColumn) - checkBoxes[i] = new QCheckBox(tr("Create Q_PROPERTY for all members")); + checkBoxes[i] = new QCheckBox(Tr::tr("Create Q_PROPERTY for all members")); createConnections(checkBoxes[i], column); } @@ -4605,8 +4582,8 @@ public: }); const auto mainLayout = new QVBoxLayout(this); - mainLayout->addWidget(new QLabel(tr("Select the getters and setters " - "to be created."))); + mainLayout->addWidget(new QLabel(Tr::tr("Select the getters and setters " + "to be created."))); for (auto checkBox : checkBoxes) { if (checkBox) mainLayout->addWidget(checkBox); @@ -4631,7 +4608,7 @@ public: GenerateGettersSettersOperation(const CppQuickFixInterface &interface) : CppQuickFixOperation(interface) { - setDescription(CppQuickFixFactory::tr("Create Getter and Setter Member Functions")); + setDescription(Tr::tr("Create Getter and Setter Member Functions")); m_classAST = astForClassOperations(interface); if (!m_classAST) @@ -4786,7 +4763,7 @@ public: , m_relevantDecls(relevantDecls) , m_functionNameGetter(functionNameGetter) { - setDescription(QCoreApplication::translate("QuickFix::ExtractFunction", "Extract Function")); + setDescription(Tr::tr("Extract Function")); } void perform() override @@ -4952,16 +4929,14 @@ public: ExtractFunctionOptions getOptions() const { QDialog dlg(Core::ICore::dialogParent()); - dlg.setWindowTitle(QCoreApplication::translate("QuickFix::ExtractFunction", - "Extract Function Refactoring")); + dlg.setWindowTitle(Tr::tr("Extract Function Refactoring")); auto layout = new QFormLayout(&dlg); - auto funcNameEdit = new Utils::FancyLineEdit; - funcNameEdit->setValidationFunction([](Utils::FancyLineEdit *edit, QString *) { + auto funcNameEdit = new FancyLineEdit; + funcNameEdit->setValidationFunction([](FancyLineEdit *edit, QString *) { return ExtractFunctionOptions::isValidFunctionName(edit->text()); }); - layout->addRow(QCoreApplication::translate("QuickFix::ExtractFunction", - "Function name"), funcNameEdit); + layout->addRow(Tr::tr("Function name"), funcNameEdit); auto accessCombo = new QComboBox; accessCombo->addItem( @@ -4982,8 +4957,7 @@ public: accessCombo->addItem( InsertionPointLocator::accessSpecToString(InsertionPointLocator::PrivateSlot), InsertionPointLocator::PrivateSlot); - layout->addRow(QCoreApplication::translate("QuickFix::ExtractFunction", - "Access"), accessCombo); + layout->addRow(Tr::tr("Access"), accessCombo); auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); QObject::connect(buttonBox, &QDialogButtonBox::accepted, &dlg, &QDialog::accept); @@ -5424,8 +5398,7 @@ public: m_literal(literal), m_functionDefinition(function) { - setDescription(QApplication::translate("CppEditor::QuickFix", - "Extract Constant as Function Parameter")); + setDescription(Tr::tr("Extract Constant as Function Parameter")); } struct FoundDeclaration @@ -5691,8 +5664,8 @@ public: { setDescription( mode == FromPointer - ? CppQuickFixFactory::tr("Convert to Stack Variable") - : CppQuickFixFactory::tr("Convert to Pointer")); + ? Tr::tr("Convert to Stack Variable") + : Tr::tr("Convert to Pointer")); } void perform() override @@ -6220,7 +6193,7 @@ void ApplyDeclDefLinkChanges::match(const CppQuickFixInterface &interface, return; auto op = new ApplyDeclDefLinkOperation(interface, link); - op->setDescription(FunctionDeclDefLink::tr("Apply Function Signature Changes")); + op->setDescription(Tr::tr("Apply Function Signature Changes")); result << op; } @@ -6367,13 +6340,10 @@ public: , m_headerFilePath(funcDef->symbol->filePath()) { if (m_type == MoveFuncDefRefactoringHelper::MoveOutside) { - setDescription(QCoreApplication::translate("CppEditor::QuickFix", - "Move Definition Outside Class")); + setDescription(Tr::tr("Move Definition Outside Class")); } else { const FilePath resolved = m_cppFilePath.relativePathFrom(m_headerFilePath.parentDir()); - setDescription(QCoreApplication::translate("CppEditor::QuickFix", - "Move Definition to %1") - .arg(resolved.displayName())); + setDescription(Tr::tr("Move Definition to %1").arg(resolved.displayName())); } } @@ -6463,12 +6433,10 @@ public: , m_headerFilePath(classDef->symbol->filePath()) { if (m_type == MoveFuncDefRefactoringHelper::MoveOutside) { - setDescription(QCoreApplication::translate("CppEditor::QuickFix", "Move All Function " - "Definitions Outside Class")); + setDescription(Tr::tr("Definitions Outside Class")); } else { const FilePath resolved = m_cppFilePath.relativePathFrom(m_headerFilePath.parentDir()); - setDescription(QCoreApplication::translate("CppEditor::QuickFix", - "Move All Function Definitions to %1") + setDescription(Tr::tr("Move All Function Definitions to %1") .arg(resolved.displayName())); } } @@ -6543,13 +6511,10 @@ public: , m_toRange(toRange) { if (m_toFilePath == m_fromFilePath) { - setDescription(QCoreApplication::translate("CppEditor::QuickFix", - "Move Definition to Class")); + setDescription(Tr::tr("Move Definition to Class")); } else { const FilePath resolved = m_toFilePath.relativePathFrom(m_fromFilePath.parentDir()); - setDescription(QCoreApplication::translate("CppEditor::QuickFix", - "Move Definition to %1") - .arg(resolved.displayName())); + setDescription(Tr::tr("Move Definition to %1").arg(resolved.displayName())); } } @@ -6725,7 +6690,7 @@ public: , m_originalName(m_oo.prettyName(m_name)) , m_file(CppRefactoringChanges(snapshot()).file(filePath())) { - setDescription(QApplication::translate("CppEditor::QuickFix", "Assign to Local Variable")); + setDescription(Tr::tr("Assign to Local Variable")); } private: @@ -6944,7 +6909,7 @@ public: , m_expression(expression) , m_type(type) { - setDescription(QApplication::translate("CppEditor::QuickFix", "Optimize for-Loop")); + setDescription(Tr::tr("Optimize for-Loop")); } void perform() override @@ -7123,11 +7088,9 @@ public: , m_escape(escape) { if (m_escape) { - setDescription(QApplication::translate("CppEditor::QuickFix", - "Escape String Literal as UTF-8")); + setDescription(Tr::tr("Escape String Literal as UTF-8")); } else { - setDescription(QApplication::translate("CppEditor::QuickFix", - "Unescape String Literal as UTF-8")); + setDescription(Tr::tr("Unescape String Literal as UTF-8")); } } @@ -7306,8 +7269,7 @@ public: ConvertQt4ConnectOperation(const CppQuickFixInterface &interface, const ChangeSet &changes) : CppQuickFixOperation(interface, 1), m_changes(changes) { - setDescription(QApplication::translate("CppEditor::QuickFix", - "Convert connect() to Qt 5 Style")); + setDescription(Tr::tr("Convert connect() to Qt 5 Style")); } private: @@ -7992,15 +7954,13 @@ public: { const QString name = Overview{}.prettyName(usingDirective->name->name); if (m_removeAllAtGlobalScope) { - setDescription(QApplication::translate( - "CppEditor::QuickFix", + setDescription(Tr::tr( "Remove All Occurrences of \"using namespace %1\" in Global Scope " "and Adjust Type Names Accordingly") .arg(name)); } else { - setDescription(QApplication::translate("CppEditor::QuickFix", - "Remove \"using namespace %1\" and " - "Adjust Type Names Accordingly") + setDescription(Tr::tr("Remove \"using namespace %1\" and " + "Adjust Type Names Accordingly") .arg(name)); } } @@ -8354,13 +8314,13 @@ public: if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { switch (section) { case ShouldInitColumn: - return tr("Initialize in Constructor"); + return Tr::tr("Initialize in Constructor"); case MemberNameColumn: - return tr("Member Name"); + return Tr::tr("Member Name"); case ParameterNameColumn: - return tr("Parameter Name"); + return Tr::tr("Parameter Name"); case DefaultValueColumn: - return tr("Default Value"); + return Tr::tr("Default Value"); } } return {}; @@ -8628,7 +8588,7 @@ public: if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { switch (section) { case 0: - return CppQuickFixFactory::tr("Base Class Constructors"); + return Tr::tr("Base Class Constructors"); } } return {}; @@ -8651,12 +8611,11 @@ public: class GenerateConstructorDialog : public QDialog { - Q_DECLARE_TR_FUNCTIONS(GenerateConstructorDialog) public: GenerateConstructorDialog(ConstructorParams *constructorParamsModel, ParentClassConstructors &constructors) { - setWindowTitle(tr("Constructor")); + setWindowTitle(Tr::tr("Constructor")); const auto treeModel = new ParentClassesModel(this, constructors); const auto treeView = new QTreeView(this); @@ -8688,7 +8647,7 @@ public: connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); const auto errorLabel = new QLabel( - tr("Parameters without default value must come before parameters with default value.")); + Tr::tr("Parameters without default value must come before parameters with default value.")); errorLabel->setStyleSheet("color: #ff0000"); errorLabel->setVisible(false); QSizePolicy labelSizePolicy = errorLabel->sizePolicy(); @@ -8702,7 +8661,7 @@ public: }); // setup select all/none checkbox - QCheckBox *const checkBox = new QCheckBox(tr("Initialize all members")); + QCheckBox *const checkBox = new QCheckBox(Tr::tr("Initialize all members")); checkBox->setChecked(true); connect(checkBox, &QCheckBox::stateChanged, [model = constructorParamsModel](int state) { if (state != Qt::PartiallyChecked) { @@ -8739,14 +8698,14 @@ public: for (auto a : {A::Public, A::Protected, A::Private}) accessCombo->addItem(InsertionPointLocator::accessSpecToString(a), a); const auto row = new QHBoxLayout(); - row->addWidget(new QLabel(tr("Access") + ":")); + row->addWidget(new QLabel(Tr::tr("Access") + ":")); row->addWidget(accessCombo); row->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum)); const auto mainLayout = new QVBoxLayout(this); mainLayout->addWidget( - new QLabel(tr("Select the members to be initialized in the constructor.\n" - "Use drag and drop to change the order of the parameters."))); + new QLabel(Tr::tr("Select the members to be initialized in the constructor.\n" + "Use drag and drop to change the order of the parameters."))); mainLayout->addLayout(row); mainLayout->addWidget(checkBox); mainLayout->addWidget(view); @@ -8771,7 +8730,7 @@ public: GenerateConstructorOperation(const CppQuickFixInterface &interface) : CppQuickFixOperation(interface) { - setDescription(CppQuickFixFactory::tr("Generate Constructor")); + setDescription(Tr::tr("Generate Constructor")); m_classAST = astForClassOperations(interface); if (!m_classAST) diff --git a/src/plugins/cppeditor/cppquickfixprojectsettings.cpp b/src/plugins/cppeditor/cppquickfixprojectsettings.cpp index 60968ab2071..3dbcf8d2047 100644 --- a/src/plugins/cppeditor/cppquickfixprojectsettings.cpp +++ b/src/plugins/cppeditor/cppquickfixprojectsettings.cpp @@ -2,8 +2,12 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "cppquickfixprojectsettings.h" + #include "cppeditorconstants.h" +#include "cppeditortr.h" + #include + #include #include #include @@ -11,10 +15,11 @@ namespace CppEditor { namespace Internal { + using namespace Constants; -static const char SETTINGS_FILE_NAME[] = ".cppQuickFix"; -static const char USE_GLOBAL_SETTINGS[] = "UseGlobalSettings"; +const char SETTINGS_FILE_NAME[] = ".cppQuickFix"; +const char USE_GLOBAL_SETTINGS[] = "UseGlobalSettings"; CppQuickFixProjectsSettings::CppQuickFixProjectsSettings(ProjectExplorer::Project *project) { @@ -103,15 +108,15 @@ bool CppQuickFixProjectsSettings::useCustomSettings() m_settingsFile = defaultLocation; } else if (m_settingsFile != defaultLocation) { QMessageBox msgBox(Core::ICore::dialogParent()); - msgBox.setText(tr("Quick Fix settings are saved in a file. Existing settings file " - "\"%1\" found. Should this file be used or a " - "new one be created?") + msgBox.setText(Tr::tr("Quick Fix settings are saved in a file. Existing settings file " + "\"%1\" found. Should this file be used or a " + "new one be created?") .arg(m_settingsFile.toString())); QPushButton *cancel = msgBox.addButton(QMessageBox::Cancel); - cancel->setToolTip(tr("Switch Back to Global Settings")); - QPushButton *useExisting = msgBox.addButton(tr("Use Existing"), QMessageBox::AcceptRole); + cancel->setToolTip(Tr::tr("Switch Back to Global Settings")); + QPushButton *useExisting = msgBox.addButton(Tr::tr("Use Existing"), QMessageBox::AcceptRole); useExisting->setToolTip(m_settingsFile.toString()); - QPushButton *createNew = msgBox.addButton(tr("Create New"), QMessageBox::ActionRole); + QPushButton *createNew = msgBox.addButton(Tr::tr("Create New"), QMessageBox::ActionRole); createNew->setToolTip(defaultLocation.toString()); msgBox.exec(); if (msgBox.clickedButton() == createNew) { diff --git a/src/plugins/cppeditor/cppquickfixprojectsettingswidget.cpp b/src/plugins/cppeditor/cppquickfixprojectsettingswidget.cpp index d595412c518..c0fb8646651 100644 --- a/src/plugins/cppeditor/cppquickfixprojectsettingswidget.cpp +++ b/src/plugins/cppeditor/cppquickfixprojectsettingswidget.cpp @@ -4,6 +4,7 @@ #include "cppquickfixprojectsettingswidget.h" #include "cppeditorconstants.h" +#include "cppeditortr.h" #include "cppquickfixsettingswidget.h" #include @@ -55,9 +56,9 @@ void CppQuickFixProjectSettingsWidget::currentItemChanged(bool useGlobalSettings { if (useGlobalSettings) { const auto &path = m_projectSettings->filePathOfSettingsFile(); - m_pushButton->setToolTip(tr("Custom settings are saved in a file. If you use the " - "global settings, you can delete that file.")); - m_pushButton->setText(tr("Delete Custom Settings File")); + m_pushButton->setToolTip(Tr::tr("Custom settings are saved in a file. If you use the " + "global settings, you can delete that file.")); + m_pushButton->setText(Tr::tr("Delete Custom Settings File")); m_pushButton->setVisible(!path.isEmpty() && path.exists()); m_projectSettings->useGlobalSettings(); } else /*Custom*/ { @@ -65,8 +66,8 @@ void CppQuickFixProjectSettingsWidget::currentItemChanged(bool useGlobalSettings setUseGlobalSettings(!m_projectSettings->useCustomSettings()); return; } - m_pushButton->setToolTip(tr("Resets all settings to the global settings.")); - m_pushButton->setText(tr("Reset to Global")); + m_pushButton->setToolTip(Tr::tr("Resets all settings to the global settings.")); + m_pushButton->setText(Tr::tr("Reset to Global")); m_pushButton->setVisible(true); // otherwise you change the comboBox and exit and have no custom settings: m_projectSettings->saveOwnSettings(); diff --git a/src/plugins/cppeditor/cppquickfixsettings.cpp b/src/plugins/cppeditor/cppquickfixsettings.cpp index 57d9414bde2..32377cc8fc9 100644 --- a/src/plugins/cppeditor/cppquickfixsettings.cpp +++ b/src/plugins/cppeditor/cppquickfixsettings.cpp @@ -12,6 +12,7 @@ #include namespace CppEditor { + CppQuickFixSettings::CppQuickFixSettings(bool loadGlobalSettings) { setDefaultSettings(); diff --git a/src/plugins/cppeditor/cppquickfixsettingspage.cpp b/src/plugins/cppeditor/cppquickfixsettingspage.cpp index ce12551f6ba..85d02130721 100644 --- a/src/plugins/cppeditor/cppquickfixsettingspage.cpp +++ b/src/plugins/cppeditor/cppquickfixsettingspage.cpp @@ -4,18 +4,19 @@ #include "cppquickfixsettingspage.h" #include "cppeditorconstants.h" +#include "cppeditortr.h" #include "cppquickfixsettings.h" #include "cppquickfixsettingswidget.h" #include #include -using namespace CppEditor::Internal; +namespace CppEditor::Internal { CppQuickFixSettingsPage::CppQuickFixSettingsPage() { setId(Constants::QUICK_FIX_SETTINGS_ID); - setDisplayName(QCoreApplication::translate("CppEditor", Constants::QUICK_FIX_SETTINGS_DISPLAY_NAME)); + setDisplayName(Tr::tr("CppEditor", Constants::QUICK_FIX_SETTINGS_DISPLAY_NAME)); setCategory(Constants::CPP_SETTINGS_CATEGORY); } @@ -35,7 +36,9 @@ void CppQuickFixSettingsPage::apply() s->saveAsGlobalSettings(); } -void CppEditor::Internal::CppQuickFixSettingsPage::finish() +void CppQuickFixSettingsPage::finish() { delete m_widget; } + +} // CppEditor::Internal diff --git a/src/plugins/cppeditor/cppquickfixsettingswidget.cpp b/src/plugins/cppeditor/cppquickfixsettingswidget.cpp index 9a03b3bcf6e..689a519ce37 100644 --- a/src/plugins/cppeditor/cppquickfixsettingswidget.cpp +++ b/src/plugins/cppeditor/cppquickfixsettingswidget.cpp @@ -2,6 +2,8 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "cppquickfixsettingswidget.h" + +#include "cppeditortr.h" #include "cppquickfixsettings.h" #include @@ -48,10 +50,10 @@ LineCountSpinBox::LineCountSpinBox(QWidget *parent) : QWidget(parent) { m_checkBox = new QCheckBox; - m_opLabel = new QLabel(QCoreApplication::translate("CppEditor::Internal::CppQuickFixSettingsWidget", "\342\211\245")); + m_opLabel = new QLabel(Tr::tr("\342\211\245")); m_spinBox = new QSpinBox; m_spinBox->setMinimum(1); - m_unitLabel = new QLabel(QCoreApplication::translate("CppEditor::Internal::CppQuickFixSettingsWidget", "lines")); + m_unitLabel = new QLabel(Tr::tr("lines")); using namespace Layouting; Row { m_checkBox, m_opLabel, m_spinBox, m_unitLabel, }.attachTo(this, WithoutMargins); @@ -103,8 +105,8 @@ CppQuickFixSettingsWidget::CppQuickFixSettingsWidget(QWidget *parent) return label; }; - const QString placeHolderTect = tr("See tool tip for more information"); - const QString toolTip = tr( + const QString placeHolderTect = Tr::tr("See tool tip for more information"); + const QString toolTip = Tr::tr( R"==(Use for the variable Use for camel case Use for snake case @@ -115,7 +117,7 @@ e.g. name = "m_test_foo_": "set => "setTestFoo")=="); m_lineEdit_getterAttribute = new QLineEdit; - m_lineEdit_getterAttribute->setPlaceholderText(tr("For example, [[nodiscard]]")); + m_lineEdit_getterAttribute->setPlaceholderText(Tr::tr("For example, [[nodiscard]]")); m_lineEdit_getterName = new QLineEdit; m_lineEdit_getterName->setPlaceholderText(placeHolderTect); m_lineEdit_getterName->setToolTip(toolTip); @@ -123,34 +125,34 @@ e.g. name = "m_test_foo_": m_lineEdit_setterName->setPlaceholderText(placeHolderTect); m_lineEdit_setterName->setToolTip(toolTip); m_lineEdit_setterParameter = new QLineEdit; - m_lineEdit_setterParameter->setPlaceholderText(tr("For example, new")); + m_lineEdit_setterParameter->setPlaceholderText(Tr::tr("For example, new")); m_lineEdit_setterParameter->setToolTip(toolTip); - m_checkBox_setterSlots = new QCheckBox(tr("Setters should be slots")); + m_checkBox_setterSlots = new QCheckBox(Tr::tr("Setters should be slots")); m_lineEdit_resetName = new QLineEdit; - m_lineEdit_resetName->setPlaceholderText(tr("Normally reset")); + m_lineEdit_resetName->setPlaceholderText(Tr::tr("Normally reset")); m_lineEdit_resetName->setToolTip(toolTip); m_lineEdit_signalName = new QLineEdit; - m_lineEdit_signalName->setPlaceholderText(tr("Normally Changed")); + m_lineEdit_signalName->setPlaceholderText(Tr::tr("Normally Changed")); m_lineEdit_signalName->setToolTip(toolTip); m_checkBox_signalWithNewValue = new QCheckBox( - tr("Generate signals with the new value as parameter")); + Tr::tr("Generate signals with the new value as parameter")); m_lineEdit_memberVariableName = new QLineEdit; - m_lineEdit_memberVariableName->setPlaceholderText(tr("For example, m_")); + m_lineEdit_memberVariableName->setPlaceholderText(Tr::tr("For example, m_")); m_lineEdit_memberVariableName->setToolTip(toolTip); - m_radioButton_generateMissingNamespace = new QRadioButton(tr("Generate missing namespaces")); - m_radioButton_addUsingnamespace = new QRadioButton(tr("Add \"using namespace ...\"")); + m_radioButton_generateMissingNamespace = new QRadioButton(Tr::tr("Generate missing namespaces")); + m_radioButton_addUsingnamespace = new QRadioButton(Tr::tr("Add \"using namespace ...\"")); m_radioButton_rewriteTypes = new QRadioButton( - tr("Rewrite types to match the existing namespaces")); + Tr::tr("Rewrite types to match the existing namespaces")); m_useAutoCheckBox = new QCheckBox(this); - m_useAutoCheckBox->setToolTip(tr("

Uncheck this to make Qt Creator try to " - "derive the type of expression in the "Assign to Local " - "Variable" quickfix.

Note that this might fail for " - "more complex types.

")); - m_useAutoCheckBox->setText(tr("Use type \"auto\" when creating new variables")); + m_useAutoCheckBox->setToolTip(Tr::tr("

Uncheck this to make Qt Creator try to " + "derive the type of expression in the "Assign to Local " + "Variable" quickfix.

Note that this might fail for " + "more complex types.

")); + m_useAutoCheckBox->setText(Tr::tr("Use type \"auto\" when creating new variables")); - m_groupBox_customTemplate = new QGroupBox(tr("Template")); + m_groupBox_customTemplate = new QGroupBox(Tr::tr("Template")); m_groupBox_customTemplate->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); m_groupBox_customTemplate->setEnabled(false); m_listWidget_customTemplates = new QListWidget; @@ -158,34 +160,34 @@ e.g. name = "m_test_foo_": m_listWidget_customTemplates->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding); m_lineEdit_customTemplateTypes = new QLineEdit; - m_lineEdit_customTemplateTypes->setToolTip(tr("Separate the types by comma.")); + m_lineEdit_customTemplateTypes->setToolTip(Tr::tr("Separate the types by comma.")); m_lineEdit_customTemplateComparison = new QLineEdit; m_lineEdit_customTemplateAssignment = new QLineEdit; m_lineEdit_customTemplateReturnExpression = new QLineEdit; m_lineEdit_customTemplateReturnType = new QLineEdit; - auto customTemplateLabel = new QLabel(tr("Use and to access the parameter and " - "current value. Use to access the type and " - "for the template parameter.")); + auto customTemplateLabel = new QLabel(Tr::tr("Use and to access the parameter and " + "current value. Use to access the type and " + "for the template parameter.")); customTemplateLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); customTemplateLabel->setWordWrap(true); auto pushButton_addCustomTemplate = new QPushButton; - pushButton_addCustomTemplate->setText(tr("Add")); - m_pushButton_removeCustomTemplate = new QPushButton(tr("Remove")); + pushButton_addCustomTemplate->setText(Tr::tr("Add")); + m_pushButton_removeCustomTemplate = new QPushButton(Tr::tr("Remove")); m_pushButton_removeCustomTemplate->setEnabled(false); m_valueTypes = new QListWidget(this); - m_valueTypes->setToolTip(tr("Normally arguments get passed by const reference. If the Type is " - "one of the following ones, the argument gets passed by value. " - "Namespaces and template arguments are removed. The real Type must " - "contain the given Type. For example, \"int\" matches \"int32_t\" " - "but not \"vector\". \"vector\" matches " - "\"std::pmr::vector\" but not " - "\"std::optional>\"")); - auto pushButton_addValueType = new QPushButton(tr("Add")); - auto pushButton_removeValueType = new QPushButton(tr("Remove")); + m_valueTypes->setToolTip(Tr::tr("Normally arguments get passed by const reference. If the Type is " + "one of the following ones, the argument gets passed by value. " + "Namespaces and template arguments are removed. The real Type must " + "contain the given Type. For example, \"int\" matches \"int32_t\" " + "but not \"vector\". \"vector\" matches " + "\"std::pmr::vector\" but not " + "\"std::optional>\"")); + auto pushButton_addValueType = new QPushButton(Tr::tr("Add")); + auto pushButton_removeValueType = new QPushButton(Tr::tr("Remove")); - m_returnByConstRefCheckBox = new QCheckBox(tr("Return non-value types by const reference")); + m_returnByConstRefCheckBox = new QCheckBox(Tr::tr("Return non-value types by const reference")); m_returnByConstRefCheckBox->setChecked(false); connect(m_listWidget_customTemplates, &QListWidget::currentItemChanged, @@ -217,45 +219,45 @@ e.g. name = "m_test_foo_": using namespace Layouting; Grid { - empty, ulLabel(tr("Generate Setters")), ulLabel(tr("Generate Getters")), br, - tr("Inside class:"), tr("Default"), tr("Default"), br, - tr("Outside class:"), m_lines_setterOutsideClass, m_lines_getterOutsideClass, br, - tr("In .cpp file:"), m_lines_setterInCppFile, m_lines_getterInCppFile, br, + empty, ulLabel(Tr::tr("Generate Setters")), ulLabel(Tr::tr("Generate Getters")), br, + Tr::tr("Inside class:"), Tr::tr("Default"), Tr::tr("Default"), br, + Tr::tr("Outside class:"), m_lines_setterOutsideClass, m_lines_getterOutsideClass, br, + Tr::tr("In .cpp file:"), m_lines_setterInCppFile, m_lines_getterInCppFile, br, }.attachTo(functionLocationsGrid, WithoutMargins); if (QGridLayout *gl = qobject_cast(functionLocationsGrid->layout())) gl->setHorizontalSpacing(48); Form { - tr("Types:"), m_lineEdit_customTemplateTypes, br, - tr("Comparison:"), m_lineEdit_customTemplateComparison, br, - tr("Assignment:"), m_lineEdit_customTemplateAssignment, br, - tr("Return expression:"), m_lineEdit_customTemplateReturnExpression, br, - tr("Return type:"), m_lineEdit_customTemplateReturnType, br, + Tr::tr("Types:"), m_lineEdit_customTemplateTypes, br, + Tr::tr("Comparison:"), m_lineEdit_customTemplateComparison, br, + Tr::tr("Assignment:"), m_lineEdit_customTemplateAssignment, br, + Tr::tr("Return expression:"), m_lineEdit_customTemplateReturnExpression, br, + Tr::tr("Return type:"), m_lineEdit_customTemplateReturnType, br, customTemplateLabel, br, }.attachTo(m_groupBox_customTemplate); Column { Group { - title(tr("Generated Function Locations")), + title(Tr::tr("Generated Function Locations")), Row { functionLocationsGrid, st, }, }, Group { - title(tr("Getter Setter Generation Properties")), + title(Tr::tr("Getter Setter Generation Properties")), Form { - tr("Getter attributes:"), m_lineEdit_getterAttribute, br, - tr("Getter name:"), m_lineEdit_getterName, br, - tr("Setter name:"), m_lineEdit_setterName, br, - tr("Setter parameter name:"), m_lineEdit_setterParameter, br, + Tr::tr("Getter attributes:"), m_lineEdit_getterAttribute, br, + Tr::tr("Getter name:"), m_lineEdit_getterName, br, + Tr::tr("Setter name:"), m_lineEdit_setterName, br, + Tr::tr("Setter parameter name:"), m_lineEdit_setterParameter, br, m_checkBox_setterSlots, br, - tr("Reset name:"), m_lineEdit_resetName, br, - tr("Signal name:"), m_lineEdit_signalName, br, + Tr::tr("Reset name:"), m_lineEdit_resetName, br, + Tr::tr("Signal name:"), m_lineEdit_signalName, br, m_checkBox_signalWithNewValue, br, - tr("Member variable name:"), m_lineEdit_memberVariableName, br, + Tr::tr("Member variable name:"), m_lineEdit_memberVariableName, br, }, }, Group { - title(tr("Missing Namespace Handling")), + title(Tr::tr("Missing Namespace Handling")), Form { m_radioButton_generateMissingNamespace, br, m_radioButton_addUsingnamespace, br, @@ -264,7 +266,7 @@ e.g. name = "m_test_foo_": }, m_useAutoCheckBox, Group { - title(tr("Custom Getter Setter Templates")), + title(Tr::tr("Custom Getter Setter Templates")), Row { Column { m_listWidget_customTemplates, @@ -274,7 +276,7 @@ e.g. name = "m_test_foo_": }, }, Group { - title(tr("Value types:")), + title(Tr::tr("Value types:")), Row { m_valueTypes, Column { pushButton_addValueType, pushButton_removeValueType, st, }, diff --git a/src/plugins/cppeditor/cppsourceprocessor.cpp b/src/plugins/cppeditor/cppsourceprocessor.cpp index f3c6dce913f..66cca58a0f7 100644 --- a/src/plugins/cppeditor/cppsourceprocessor.cpp +++ b/src/plugins/cppeditor/cppsourceprocessor.cpp @@ -3,12 +3,13 @@ #include "cppsourceprocessor.h" +#include "cppeditortr.h" #include "cppmodelmanager.h" #include "cpptoolsreuse.h" #include -#include +#include #include #include #include @@ -65,16 +66,14 @@ inline QByteArray generateFingerPrint(const QList &definedMacr inline Message messageNoSuchFile(Document::Ptr &document, const FilePath &filePath, unsigned line) { - const QString text = QCoreApplication::translate( - "CppSourceProcessor", "%1: No such file or directory").arg(filePath.displayName()); + const QString text = Tr::tr("%1: No such file or directory").arg(filePath.displayName()); return Message(Message::Warning, document->filePath(), line, /*column =*/ 0, text); } inline Message messageNoFileContents(Document::Ptr &document, const FilePath &filePath, unsigned line) { - const QString text = QCoreApplication::translate( - "CppSourceProcessor", "%1: Could not get file contents").arg(filePath.displayName()); + const QString text = Tr::tr("%1: Could not get file contents").arg(filePath.displayName()); return Message(Message::Warning, document->filePath(), line, /*column =*/ 0, text); } diff --git a/src/plugins/cppeditor/cpptoolsreuse.cpp b/src/plugins/cppeditor/cpptoolsreuse.cpp index 2b2de0e59dc..7d17e30e4bc 100644 --- a/src/plugins/cppeditor/cpptoolsreuse.cpp +++ b/src/plugins/cppeditor/cpptoolsreuse.cpp @@ -9,6 +9,7 @@ #include "cppcompletionassist.h" #include "cppeditorconstants.h" #include "cppeditorplugin.h" +#include "cppeditortr.h" #include "cppfilesettingspage.h" #include "cpphighlighter.h" #include "cppqtstyleindenter.h" @@ -344,9 +345,7 @@ bool fileSizeExceedsLimit(const FilePath &filePath, int sizeLimitInMb) const qint64 fileSizeInMB = filePath.fileSize() / (1000 * 1000); if (fileSizeInMB > sizeLimitInMb) { - const QString msg = QCoreApplication::translate( - "CppIndexer", - "C++ Indexer: Skipping file \"%1\" because it is too big.") + const QString msg = Tr::tr("C++ Indexer: Skipping file \"%1\" because it is too big.") .arg(filePath.displayName()); QMetaObject::invokeMethod(Core::MessageManager::instance(), @@ -373,9 +372,7 @@ static void addBuiltinConfigs(ClangDiagnosticConfigsModel &model) // Questionable constructs config = ClangDiagnosticConfig(); config.setId(Constants::CPP_CLANG_DIAG_CONFIG_QUESTIONABLE); - config.setDisplayName(QCoreApplication::translate( - "ClangDiagnosticConfigsModel", - "Checks for questionable constructs")); + config.setDisplayName(Tr::tr("Checks for questionable constructs")); config.setIsReadOnly(true); config.setClangOptions({ "-Wall", @@ -388,8 +385,7 @@ static void addBuiltinConfigs(ClangDiagnosticConfigsModel &model) // Warning flags from build system config = ClangDiagnosticConfig(); config.setId(Constants::CPP_CLANG_DIAG_CONFIG_BUILDSYSTEM); - config.setDisplayName(QCoreApplication::translate("ClangDiagnosticConfigsModel", - "Build-system warnings")); + config.setDisplayName(Tr::tr("Build-system warnings")); config.setIsReadOnly(true); config.setClazyMode(ClangDiagnosticConfig::ClazyMode::UseCustomChecks); config.setClangTidyMode(ClangDiagnosticConfig::TidyMode::UseCustomChecks); diff --git a/src/plugins/cppeditor/cpptoolssettings.cpp b/src/plugins/cppeditor/cpptoolssettings.cpp index 9a8937917e9..3d5b4658b84 100644 --- a/src/plugins/cppeditor/cpptoolssettings.cpp +++ b/src/plugins/cppeditor/cpptoolssettings.cpp @@ -4,6 +4,7 @@ #include "cpptoolssettings.h" #include "cppeditorconstants.h" +#include "cppeditortr.h" #include "cppcodestylepreferences.h" #include "cppcodestylepreferencesfactory.h" @@ -61,7 +62,7 @@ CppToolsSettings::CppToolsSettings() // global code style settings d->m_globalCodeStyle = new CppCodeStylePreferences(this); d->m_globalCodeStyle->setDelegatingPool(pool); - d->m_globalCodeStyle->setDisplayName(tr("Global", "Settings")); + d->m_globalCodeStyle->setDisplayName(Tr::tr("Global", "Settings")); d->m_globalCodeStyle->setId(idKey); pool->addCodeStyle(d->m_globalCodeStyle); TextEditorSettings::registerCodeStyle(Constants::CPP_SETTINGS_ID, d->m_globalCodeStyle); @@ -95,7 +96,7 @@ CppToolsSettings::CppToolsSettings() // Qt style auto qtCodeStyle = new CppCodeStylePreferences; qtCodeStyle->setId("qt"); - qtCodeStyle->setDisplayName(tr("Qt")); + qtCodeStyle->setDisplayName(Tr::tr("Qt")); qtCodeStyle->setReadOnly(true); TabSettings qtTabSettings; qtTabSettings.m_tabPolicy = TabSettings::SpacesOnlyTabPolicy; @@ -108,7 +109,7 @@ CppToolsSettings::CppToolsSettings() // GNU style auto gnuCodeStyle = new CppCodeStylePreferences; gnuCodeStyle->setId("gnu"); - gnuCodeStyle->setDisplayName(tr("GNU")); + gnuCodeStyle->setDisplayName(Tr::tr("GNU")); gnuCodeStyle->setReadOnly(true); TabSettings gnuTabSettings; gnuTabSettings.m_tabPolicy = TabSettings::MixedTabPolicy; @@ -169,7 +170,7 @@ CppToolsSettings::CppToolsSettings() QVariant v; v.setValue(legacyCodeStyleSettings); ICodeStylePreferences *oldCreator = pool->createCodeStyle( - "legacy", legacyTabSettings, v, tr("Old Creator")); + "legacy", legacyTabSettings, v, Tr::tr("Old Creator")); // change the current delegate and save d->m_globalCodeStyle->setCurrentDelegate(oldCreator); diff --git a/src/plugins/cppeditor/cpptypehierarchy.cpp b/src/plugins/cppeditor/cpptypehierarchy.cpp index c82ad131ba1..c7a9e472ca5 100644 --- a/src/plugins/cppeditor/cpptypehierarchy.cpp +++ b/src/plugins/cppeditor/cpptypehierarchy.cpp @@ -4,6 +4,7 @@ #include "cpptypehierarchy.h" #include "cppeditorconstants.h" +#include "cppeditortr.h" #include "cppeditorwidget.h" #include "cppeditorplugin.h" #include "cppelementevaluator.h" @@ -84,20 +85,20 @@ void CppTypeHierarchyTreeView::contextMenuEvent(QContextMenuEvent *event) QMenu contextMenu; - QAction *action = contextMenu.addAction(tr("Open in Editor")); + QAction *action = contextMenu.addAction(Tr::tr("Open in Editor")); connect(action, &QAction::triggered, this, [this] () { emit activated(currentIndex()); }); - action = contextMenu.addAction(tr("Open Type Hierarchy")); + action = contextMenu.addAction(Tr::tr("Open Type Hierarchy")); connect(action, &QAction::triggered, this, [this] () { emit doubleClicked(currentIndex()); }); contextMenu.addSeparator(); - action = contextMenu.addAction(tr("Expand All")); + action = contextMenu.addAction(Tr::tr("Expand All")); connect(action, &QAction::triggered, this, &QTreeView::expandAll); - action = contextMenu.addAction(tr("Collapse All")); + action = contextMenu.addAction(Tr::tr("Collapse All")); connect(action, &QAction::triggered, this, &QTreeView::collapseAll); contextMenu.exec(event->globalPos()); @@ -182,7 +183,7 @@ void CppTypeHierarchyWidget::perform() m_futureWatcher.setFuture(QFuture(m_future)); m_synchronizer.addFuture(m_future); - Core::ProgressManager::addTask(m_future, tr("Evaluating Type Hierarchy"), "TypeHierarchy"); + Core::ProgressManager::addTask(m_future, Tr::tr("Evaluating Type Hierarchy"), "TypeHierarchy"); } void CppTypeHierarchyWidget::performFromExpression(const QString &expression, const FilePath &filePath) @@ -198,7 +199,7 @@ void CppTypeHierarchyWidget::performFromExpression(const QString &expression, co m_futureWatcher.setFuture(QFuture(m_future)); m_synchronizer.addFuture(m_future); - Core::ProgressManager::addTask(m_future, tr("Evaluating Type Hierarchy"), "TypeHierarchy"); + Core::ProgressManager::addTask(m_future, Tr::tr("Evaluating Type Hierarchy"), "TypeHierarchy"); } void CppTypeHierarchyWidget::displayHierarchy() @@ -224,10 +225,10 @@ void CppTypeHierarchyWidget::displayHierarchy() m_inspectedClass->setText(cppClass->name); m_inspectedClass->setLink(cppClass->link); - QStandardItem *bases = new QStandardItem(tr("Bases")); + QStandardItem *bases = new QStandardItem(Tr::tr("Bases")); m_model->invisibleRootItem()->appendRow(bases); QStandardItem *selectedItem1 = buildHierarchy(*cppClass, bases, true, &CppClass::bases); - QStandardItem *derived = new QStandardItem(tr("Derived")); + QStandardItem *derived = new QStandardItem(Tr::tr("Derived")); m_model->invisibleRootItem()->appendRow(derived); QStandardItem *selectedItem2 = buildHierarchy(*cppClass, derived, true, &CppClass::derived); m_treeView->expandAll(); @@ -263,7 +264,7 @@ QStandardItem *CppTypeHierarchyWidget::buildHierarchy(const CppClass &cppClass, void CppTypeHierarchyWidget::showNoTypeHierarchyLabel() { - m_infoLabel->setText(tr("No type hierarchy available")); + m_infoLabel->setText(Tr::tr("No type hierarchy available")); m_stackLayout->setCurrentWidget(m_infoLabel); } @@ -274,7 +275,7 @@ void CppTypeHierarchyWidget::showTypeHierarchy() void CppTypeHierarchyWidget::showProgress() { - m_infoLabel->setText(tr("Evaluating type hierarchy...")); + m_infoLabel->setText(Tr::tr("Evaluating type hierarchy...")); if (!m_progressIndicator) { m_progressIndicator = new ProgressIndicator(ProgressIndicatorSize::Large); m_progressIndicator->attachToWidget(this); @@ -326,7 +327,7 @@ void CppTypeHierarchyWidget::onItemDoubleClicked(const QModelIndex &index) // CppTypeHierarchyFactory CppTypeHierarchyFactory::CppTypeHierarchyFactory() { - setDisplayName(tr("Type Hierarchy")); + setDisplayName(Tr::tr("Type Hierarchy")); setPriority(700); setId(Constants::TYPE_HIERARCHY_ID); } diff --git a/src/plugins/cppeditor/cppvirtualfunctionassistprovider.cpp b/src/plugins/cppeditor/cppvirtualfunctionassistprovider.cpp index 8741aee3e40..19fc0890257 100644 --- a/src/plugins/cppeditor/cppvirtualfunctionassistprovider.cpp +++ b/src/plugins/cppeditor/cppvirtualfunctionassistprovider.cpp @@ -5,6 +5,7 @@ #include "cppvirtualfunctionproposalitem.h" +#include "cppeditortr.h" #include "cpptoolsreuse.h" #include "functionutils.h" #include "symbolfinder.h" @@ -93,8 +94,7 @@ public: QTC_ASSERT(m_params.function, return nullptr); auto *hintItem = new VirtualFunctionProposalItem(Utils::Link()); - hintItem->setText(QCoreApplication::translate("VirtualFunctionsAssistProcessor", - "collecting overrides ...")); + hintItem->setText(Tr::tr("collecting overrides ...")); hintItem->setOrder(-1000); QList items; diff --git a/src/plugins/cppeditor/symbolsfindfilter.cpp b/src/plugins/cppeditor/symbolsfindfilter.cpp index 7114beb5ab7..ed8dd833620 100644 --- a/src/plugins/cppeditor/symbolsfindfilter.cpp +++ b/src/plugins/cppeditor/symbolsfindfilter.cpp @@ -4,6 +4,7 @@ #include "symbolsfindfilter.h" #include "cppeditorconstants.h" +#include "cppeditortr.h" #include "cppmodelmanager.h" #include @@ -121,7 +122,7 @@ void SymbolsFindFilter::startSearch(SearchResult *search) symbolSearcher, &QObject::deleteLater); watcher->setFuture(Utils::runAsync(m_manager->sharedThreadPool(), &SymbolSearcher::runSearch, symbolSearcher)); - FutureProgress *progress = ProgressManager::addTask(watcher->future(), tr("Searching for Symbol"), + FutureProgress *progress = ProgressManager::addTask(watcher->future(), Tr::tr("Searching for Symbol"), Core::Constants::TASK_SEARCH); connect(progress, &FutureProgress::clicked, search, &SearchResult::popup); } @@ -203,22 +204,22 @@ void SymbolsFindFilter::onAllTasksFinished(Id type) QString SymbolsFindFilter::label() const { - return tr("C++ Symbols:"); + return Tr::tr("C++ Symbols:"); } QString SymbolsFindFilter::toolTip(FindFlags findFlags) const { QStringList types; if (m_symbolsToSearch & SymbolSearcher::Classes) - types.append(tr("Classes")); + types.append(Tr::tr("Classes")); if (m_symbolsToSearch & SymbolSearcher::Functions) - types.append(tr("Functions")); + types.append(Tr::tr("Functions")); if (m_symbolsToSearch & SymbolSearcher::Enums) - types.append(tr("Enums")); + types.append(Tr::tr("Enums")); if (m_symbolsToSearch & SymbolSearcher::Declarations) - types.append(tr("Declarations")); - return tr("Scope: %1\nTypes: %2\nFlags: %3") - .arg(searchScope() == SymbolSearcher::SearchGlobal ? tr("All") : tr("Projects"), + types.append(Tr::tr("Declarations")); + return Tr::tr("Scope: %1\nTypes: %2\nFlags: %3") + .arg(searchScope() == SymbolSearcher::SearchGlobal ? Tr::tr("All") : Tr::tr("Projects"), types.join(", "), IFindFilter::descriptionForFindFlags(findFlags)); } @@ -235,19 +236,19 @@ SymbolsFindFilterConfigWidget::SymbolsFindFilterConfigWidget(SymbolsFindFilter * setLayout(layout); layout->setContentsMargins(0, 0, 0, 0); - auto typeLabel = new QLabel(tr("Types:")); + auto typeLabel = new QLabel(Tr::tr("Types:")); layout->addWidget(typeLabel, 0, 0); - m_typeClasses = new QCheckBox(tr("Classes")); + m_typeClasses = new QCheckBox(Tr::tr("Classes")); layout->addWidget(m_typeClasses, 0, 1); - m_typeMethods = new QCheckBox(tr("Functions")); + m_typeMethods = new QCheckBox(Tr::tr("Functions")); layout->addWidget(m_typeMethods, 0, 2); - m_typeEnums = new QCheckBox(tr("Enums")); + m_typeEnums = new QCheckBox(Tr::tr("Enums")); layout->addWidget(m_typeEnums, 1, 1); - m_typeDeclarations = new QCheckBox(tr("Declarations")); + m_typeDeclarations = new QCheckBox(Tr::tr("Declarations")); layout->addWidget(m_typeDeclarations, 1, 2); // hacks to fix layouting: @@ -265,10 +266,10 @@ SymbolsFindFilterConfigWidget::SymbolsFindFilterConfigWidget(SymbolsFindFilter * connect(m_typeDeclarations, &QAbstractButton::clicked, this, &SymbolsFindFilterConfigWidget::setState); - m_searchProjectsOnly = new QRadioButton(tr("Projects only")); + m_searchProjectsOnly = new QRadioButton(Tr::tr("Projects only")); layout->addWidget(m_searchProjectsOnly, 2, 1); - m_searchGlobal = new QRadioButton(tr("All files")); + m_searchGlobal = new QRadioButton(Tr::tr("All files")); layout->addWidget(m_searchGlobal, 2, 2); m_searchGroup = new QButtonGroup(this);