ClangFormat: Tr::tr()

Change-Id: Iabbe39bfdd3ae24d65610a00d792e16591a1b6ee
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2023-02-04 01:46:50 +01:00
parent 48affa1889
commit 389b9503d7
8 changed files with 26 additions and 40 deletions

View File

@@ -41695,7 +41695,7 @@ Was soll %1 tun?</translation>
</message> </message>
</context> </context>
<context> <context>
<name>ClangFormat::ClangFormatConfigWidget</name> <name>::ClangFormat</name>
<message> <message>
<source>Clang-Format Style</source> <source>Clang-Format Style</source>
<translation>Clang-Format-Stil</translation> <translation>Clang-Format-Stil</translation>
@@ -41709,7 +41709,7 @@ Was soll %1 tun?</translation>
</message> </message>
</context> </context>
<context> <context>
<name>ClangFormat::ClangFormatPlugin</name> <name>::ClangFormat</name>
<message> <message>
<source>Open Used .clang-format Configuration File</source> <source>Open Used .clang-format Configuration File</source>
<translation>Verwendete .clang-format-Konfigurationsdatei öffnen</translation> <translation>Verwendete .clang-format-Konfigurationsdatei öffnen</translation>
@@ -50556,7 +50556,7 @@ in &quot;%2&quot; aus.
</message> </message>
</context> </context>
<context> <context>
<name>ClangFormat::ClangFormatGlobalConfigWidget</name> <name>::ClangFormat</name>
<message> <message>
<source>Formatting mode:</source> <source>Formatting mode:</source>
<translation>Formatierungsart:</translation> <translation>Formatierungsart:</translation>
@@ -50597,9 +50597,6 @@ in &quot;%2&quot; aus.
<source>Override Clang Format configuration file with the chosen configuration.</source> <source>Override Clang Format configuration file with the chosen configuration.</source>
<translation>Die Clang-Format-Konfigurationsdatei mit der gewählten Konfiguration überschreiben.</translation> <translation>Die Clang-Format-Konfigurationsdatei mit der gewählten Konfiguration überschreiben.</translation>
</message> </message>
</context>
<context>
<name>ClangFormatStyleFactory</name>
<message> <message>
<source>ClangFormat</source> <source>ClangFormat</source>
<translation>ClangFormat</translation> <translation>ClangFormat</translation>

View File

@@ -1695,7 +1695,7 @@ Međutim, korištenje opuštenih i proširenih pravila također znači da nije m
</message> </message>
</context> </context>
<context> <context>
<name>ClangFormat::ClangFormatConfigWidget</name> <name>::ClangFormat</name>
<message> <message>
<source>Format instead of indenting</source> <source>Format instead of indenting</source>
<translation>Formatiraj umjesto uvlačenja</translation> <translation>Formatiraj umjesto uvlačenja</translation>
@@ -15655,7 +15655,7 @@ Check the test environment.</source>
</message> </message>
</context> </context>
<context> <context>
<name>ClangFormat::ClangFormatPlugin</name> <name>::ClangFormat</name>
<message> <message>
<source>Open Used .clang-format Configuration File</source> <source>Open Used .clang-format Configuration File</source>
<translation>Otvori korištenu konfiguracijsku datoteku .clang-formata</translation> <translation>Otvori korištenu konfiguracijsku datoteku .clang-formata</translation>

View File

@@ -42131,7 +42131,7 @@ Output:
</message> </message>
</context> </context>
<context> <context>
<name>ClangFormat::ClangFormatConfigWidget</name> <name>::ClangFormat</name>
<message> <message>
<source>Format instead of indenting</source> <source>Format instead of indenting</source>
<translation></translation> <translation></translation>
@@ -44212,7 +44212,7 @@ The name of the release build configuration created by default for a qmake proje
</message> </message>
</context> </context>
<context> <context>
<name>ClangFormat::ClangFormatPlugin</name> <name>::ClangFormat</name>
<message> <message>
<source>Open Used .clang-format Configuration File</source> <source>Open Used .clang-format Configuration File</source>
<translation>使 clang-format </translation> <translation>使 clang-format </translation>

View File

@@ -6367,7 +6367,7 @@ However, using the relaxed and extended rules means also that no highlighting/co
</message> </message>
</context> </context>
<context> <context>
<name>ClangFormat::ClangFormatConfigWidget</name> <name>::ClangFormat</name>
<message> <message>
<source>Apply</source> <source>Apply</source>
<translation>Применить</translation> <translation>Применить</translation>
@@ -6404,9 +6404,6 @@ However, using the relaxed and extended rules means also that no highlighting/co
<source>Fallback configuration</source> <source>Fallback configuration</source>
<translation>Запасная конфигурация</translation> <translation>Запасная конфигурация</translation>
</message> </message>
</context>
<context>
<name>ClangFormat::ClangFormatPlugin</name>
<message> <message>
<source>Open Used .clang-format Configuration File</source> <source>Open Used .clang-format Configuration File</source>
<translation>Открыть использованный файл настроек .clang-format</translation> <translation>Открыть использованный файл настроек .clang-format</translation>

View File

@@ -6960,14 +6960,11 @@ However, using the relaxed and extended rules means also that no highlighting/co
</message> </message>
</context> </context>
<context> <context>
<name>ClangFormat::ClangFormatConfigWidget</name> <name>::ClangFormat</name>
<message> <message>
<source>Clang-Format Style</source> <source>Clang-Format Style</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context>
<context>
<name>ClangFormat::ClangFormatGlobalConfigWidget</name>
<message> <message>
<source>ClangFormat global setting:</source> <source>ClangFormat global setting:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -7008,9 +7005,6 @@ However, using the relaxed and extended rules means also that no highlighting/co
<source>Override Clang Format configuration file with the chosen configuration.</source> <source>Override Clang Format configuration file with the chosen configuration.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context>
<context>
<name>ClangFormat::ClangFormatPlugin</name>
<message> <message>
<source>Open Used .clang-format Configuration File</source> <source>Open Used .clang-format Configuration File</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@@ -7019,9 +7013,6 @@ However, using the relaxed and extended rules means also that no highlighting/co
<source>The ClangFormat plugin has been built against an unmodified Clang. You might experience formatting glitches in certain circumstances. See https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/README.md for more information.</source> <source>The ClangFormat plugin has been built against an unmodified Clang. You might experience formatting glitches in certain circumstances. See https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/README.md for more information.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context>
<context>
<name>ClangFormatStyleFactory</name>
<message> <message>
<source>ClangFormat</source> <source>ClangFormat</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>

View File

@@ -7,6 +7,7 @@
#include "clangformatconstants.h" #include "clangformatconstants.h"
#include "clangformatfile.h" #include "clangformatfile.h"
#include "clangformatindenter.h" #include "clangformatindenter.h"
#include "clangformattr.h"
#include "clangformatutils.h" #include "clangformatutils.h"
// the file was generated by scripts/generateClangFormatChecksLayout.py // the file was generated by scripts/generateClangFormatChecksLayout.py
@@ -82,7 +83,7 @@ ClangFormatConfigWidget::ClangFormatConfigWidget(TextEditor::ICodeStylePreferenc
d->config = std::make_unique<ClangFormatFile>(filePathToCurrentSettings(codeStyle->currentPreferences())); d->config = std::make_unique<ClangFormatFile>(filePathToCurrentSettings(codeStyle->currentPreferences()));
resize(489, 305); resize(489, 305);
d->fallbackConfig = new QLabel(tr("Clang-Format Style")); d->fallbackConfig = new QLabel(Tr::tr("Clang-Format Style"));
d->checksScrollArea = new QScrollArea(); d->checksScrollArea = new QScrollArea();
d->checksWidget = new ClangFormatChecks(); d->checksWidget = new ClangFormatChecks();

View File

@@ -5,6 +5,7 @@
#include "clangformatconstants.h" #include "clangformatconstants.h"
#include "clangformatsettings.h" #include "clangformatsettings.h"
#include "clangformattr.h"
#include "clangformatutils.h" #include "clangformatutils.h"
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
@@ -31,18 +32,18 @@ ClangFormatGlobalConfigWidget::ClangFormatGlobalConfigWidget(ProjectExplorer::Pr
resize(489, 305); resize(489, 305);
m_projectHasClangFormat = new QLabel(this); m_projectHasClangFormat = new QLabel(this);
m_formattingModeLabel = new QLabel(tr("Formatting mode:")); m_formattingModeLabel = new QLabel(Tr::tr("Formatting mode:"));
m_indentingOrFormatting = new QComboBox(this); m_indentingOrFormatting = new QComboBox(this);
m_formatWhileTyping = new QCheckBox(tr("Format while typing")); m_formatWhileTyping = new QCheckBox(Tr::tr("Format while typing"));
m_formatOnSave = new QCheckBox(tr("Format edited code on file save")); m_formatOnSave = new QCheckBox(Tr::tr("Format edited code on file save"));
m_overrideDefault = new QCheckBox(tr("Override Clang Format configuration file")); m_overrideDefault = new QCheckBox(Tr::tr("Override Clang Format configuration file"));
m_useGlobalSettings = new QCheckBox(tr("Use global settings")); m_useGlobalSettings = new QCheckBox(Tr::tr("Use global settings"));
m_useGlobalSettings->hide(); m_useGlobalSettings->hide();
using namespace Layouting; using namespace Layouting;
Group globalSettingsGroupBox { Group globalSettingsGroupBox {
title(tr("ClangFormat settings:")), title(Tr::tr("ClangFormat settings:")),
Column { Column {
m_useGlobalSettings, m_useGlobalSettings,
Row { m_formattingModeLabel, m_indentingOrFormatting, st }, Row { m_formattingModeLabel, m_indentingOrFormatting, st },
@@ -94,11 +95,11 @@ void ClangFormatGlobalConfigWidget::initCheckBoxes()
void ClangFormatGlobalConfigWidget::initIndentationOrFormattingCombobox() void ClangFormatGlobalConfigWidget::initIndentationOrFormattingCombobox()
{ {
m_indentingOrFormatting->insertItem(static_cast<int>(ClangFormatSettings::Mode::Indenting), m_indentingOrFormatting->insertItem(static_cast<int>(ClangFormatSettings::Mode::Indenting),
tr("Indenting only")); Tr::tr("Indenting only"));
m_indentingOrFormatting->insertItem(static_cast<int>(ClangFormatSettings::Mode::Formatting), m_indentingOrFormatting->insertItem(static_cast<int>(ClangFormatSettings::Mode::Formatting),
tr("Full formatting")); Tr::tr("Full formatting"));
m_indentingOrFormatting->insertItem(static_cast<int>(ClangFormatSettings::Mode::Disable), m_indentingOrFormatting->insertItem(static_cast<int>(ClangFormatSettings::Mode::Disable),
tr("Disable")); Tr::tr("Disable"));
m_indentingOrFormatting->setCurrentIndex( m_indentingOrFormatting->setCurrentIndex(
static_cast<int>(getProjectIndentationOrFormattingSettings(m_project))); static_cast<int>(getProjectIndentationOrFormattingSettings(m_project)));
@@ -146,8 +147,8 @@ void ClangFormatGlobalConfigWidget::initOverrideCheckBox()
m_projectHasClangFormat->hide(); m_projectHasClangFormat->hide();
} else { } else {
m_projectHasClangFormat->show(); m_projectHasClangFormat->show();
m_projectHasClangFormat->setText(tr("The current project has its own .clang-format file which " m_projectHasClangFormat->setText(Tr::tr("The current project has its own .clang-format file which "
"can be overridden by the settings below.")); "can be overridden by the settings below."));
} }
auto setEnableOverrideCheckBox = [this](int index) { auto setEnableOverrideCheckBox = [this](int index) {
@@ -160,7 +161,7 @@ void ClangFormatGlobalConfigWidget::initOverrideCheckBox()
this, setEnableOverrideCheckBox); this, setEnableOverrideCheckBox);
m_overrideDefault->setToolTip( m_overrideDefault->setToolTip(
tr("Override Clang Format configuration file with the chosen configuration.")); Tr::tr("Override Clang Format configuration file with the chosen configuration."));
m_overrideDefault->setChecked(getProjectOverriddenSettings(m_project)); m_overrideDefault->setChecked(getProjectOverriddenSettings(m_project));

View File

@@ -37,7 +37,6 @@ namespace ClangFormat {
class ClangFormatStyleFactory : public CppCodeStylePreferencesFactory class ClangFormatStyleFactory : public CppCodeStylePreferencesFactory
{ {
Q_DECLARE_TR_FUNCTIONS(ClangFormatStyleFactory)
public: public:
Indenter *createIndenter(QTextDocument *doc) const override Indenter *createIndenter(QTextDocument *doc) const override
{ {
@@ -47,7 +46,7 @@ public:
std::pair<CppCodeStyleWidget *, QString> additionalTab( std::pair<CppCodeStyleWidget *, QString> additionalTab(
ICodeStylePreferences *codeStyle, Project *project, QWidget *parent) const override ICodeStylePreferences *codeStyle, Project *project, QWidget *parent) const override
{ {
return {new ClangFormatConfigWidget(codeStyle, project, parent), tr("ClangFormat")}; return {new ClangFormatConfigWidget(codeStyle, project, parent), Tr::tr("ClangFormat")};
} }
CodeStyleEditorWidget *createAdditionalGlobalSettings( CodeStyleEditorWidget *createAdditionalGlobalSettings(
@@ -72,7 +71,7 @@ void ClangFormatPlugin::initialize()
ActionContainer *contextMenu = ActionManager::actionContainer(CppEditor::Constants::M_CONTEXT); ActionContainer *contextMenu = ActionManager::actionContainer(CppEditor::Constants::M_CONTEXT);
if (contextMenu) { if (contextMenu) {
auto openClangFormatConfigAction auto openClangFormatConfigAction
= new QAction(tr("Open Used .clang-format Configuration File"), this); = new QAction(Tr::tr("Open Used .clang-format Configuration File"), this);
Command *command = ActionManager::registerAction(openClangFormatConfigAction, Command *command = ActionManager::registerAction(openClangFormatConfigAction,
Constants::OPEN_CURRENT_CONFIG_ID); Constants::OPEN_CURRENT_CONFIG_ID);
contextMenu->addSeparator(); contextMenu->addSeparator();