forked from qt-creator/qt-creator
Beautifier: Fix untranslated DISPLAY_NAME
Change-Id: Ifad91eaada5f7614767b6332a643723de79fc6b2 Reviewed-by: Lorenz Haas <lorenz.haas@histomatics.de> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
74fed1d5b7
commit
88819d0490
@@ -69,7 +69,7 @@ ArtisticStyle::~ArtisticStyle()
|
||||
bool ArtisticStyle::initialize()
|
||||
{
|
||||
Core::ActionContainer *menu = Core::ActionManager::createMenu(Constants::ArtisticStyle::MENU_ID);
|
||||
menu->menu()->setTitle(Constants::ArtisticStyle::DISPLAY_NAME);
|
||||
menu->menu()->setTitle(tr(Constants::ArtisticStyle::DISPLAY_NAME));
|
||||
|
||||
m_formatFile = new QAction(BeautifierPlugin::msgFormatCurrentFile(), this);
|
||||
menu->addAction(Core::ActionManager::registerAction(m_formatFile,
|
||||
@@ -104,7 +104,7 @@ void ArtisticStyle::formatFile()
|
||||
const QString cfgFileName = configurationFile();
|
||||
if (cfgFileName.isEmpty()) {
|
||||
BeautifierPlugin::showError(BeautifierPlugin::msgCannotGetConfigurationFile(
|
||||
Constants::ArtisticStyle::DISPLAY_NAME));
|
||||
tr(Constants::ArtisticStyle::DISPLAY_NAME)));
|
||||
} else {
|
||||
m_beautifierPlugin->formatCurrentFile(command(cfgFileName));
|
||||
}
|
||||
|
@@ -25,11 +25,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
namespace Beautifier {
|
||||
namespace Constants {
|
||||
namespace ArtisticStyle {
|
||||
|
||||
const char DISPLAY_NAME[] = "Artistic Style";
|
||||
const char DISPLAY_NAME[] = QT_TRANSLATE_NOOP("Beautifier::Internal::ArtisticStyle::ArtisticStyle", "Artistic Style");
|
||||
const char ACTION_FORMATFILE[] = "ArtisticStyle.FormatFile";
|
||||
const char MENU_ID[] = "ArtisticStyle.Menu";
|
||||
const char OPTION_ID[] = "ArtisticStyle";
|
||||
|
@@ -28,6 +28,7 @@
|
||||
|
||||
#include "artisticstyleconstants.h"
|
||||
#include "artisticstylesettings.h"
|
||||
#include "artisticstyle.h"
|
||||
|
||||
#include "../beautifierconstants.h"
|
||||
#include "../beautifierplugin.h"
|
||||
@@ -49,7 +50,7 @@ ArtisticStyleOptionsPageWidget::ArtisticStyleOptionsPageWidget(ArtisticStyleSett
|
||||
"HOME", QDir::toNativeSeparators(QDir::home().absolutePath())));
|
||||
ui->command->setExpectedKind(Utils::PathChooser::ExistingCommand);
|
||||
ui->command->setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle(
|
||||
Constants::ArtisticStyle::DISPLAY_NAME));
|
||||
ArtisticStyle::tr(Constants::ArtisticStyle::DISPLAY_NAME)));
|
||||
connect(ui->command, &Utils::PathChooser::validChanged, ui->options, &QWidget::setEnabled);
|
||||
ui->configurations->setSettings(m_settings);
|
||||
}
|
||||
|
@@ -101,7 +101,7 @@ FormatTask format(FormatTask task)
|
||||
process.setTimeoutS(5);
|
||||
Utils::SynchronousProcessResponse response = process.runBlocking(executable, options);
|
||||
if (response.result != Utils::SynchronousProcessResponse::Finished) {
|
||||
task.error = QObject::tr("Failed to format: %1.").arg(response.exitMessage(executable, 5));
|
||||
task.error = BeautifierPlugin::tr("Failed to format: %1.").arg(response.exitMessage(executable, 5));
|
||||
return task;
|
||||
}
|
||||
const QString output = response.stdErr;
|
||||
|
@@ -73,7 +73,7 @@ QString ClangFormat::id() const
|
||||
bool ClangFormat::initialize()
|
||||
{
|
||||
Core::ActionContainer *menu = Core::ActionManager::createMenu(Constants::ClangFormat::MENU_ID);
|
||||
menu->menu()->setTitle(Constants::ClangFormat::DISPLAY_NAME);
|
||||
menu->menu()->setTitle(tr(Constants::ClangFormat::DISPLAY_NAME));
|
||||
|
||||
m_formatFile = new QAction(BeautifierPlugin::msgFormatCurrentFile(), this);
|
||||
Core::Command *cmd
|
||||
|
@@ -25,11 +25,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
namespace Beautifier {
|
||||
namespace Constants {
|
||||
namespace ClangFormat {
|
||||
|
||||
const char DISPLAY_NAME[] = "ClangFormat";
|
||||
const char DISPLAY_NAME[] = QT_TRANSLATE_NOOP("Beautifier::Internal::ClangFormat::ClangFormat", "ClangFormat");
|
||||
const char ACTION_FORMATFILE[] = "ClangFormat.FormatFile";
|
||||
const char ACTION_FORMATSELECTED[] = "ClangFormat.FormatSelectedText";
|
||||
const char MENU_ID[] = "ClangFormat.Menu";
|
||||
|
@@ -69,7 +69,7 @@ Uncrustify::~Uncrustify()
|
||||
bool Uncrustify::initialize()
|
||||
{
|
||||
Core::ActionContainer *menu = Core::ActionManager::createMenu(Constants::Uncrustify::MENU_ID);
|
||||
menu->menu()->setTitle(Constants::Uncrustify::DISPLAY_NAME);
|
||||
menu->menu()->setTitle(tr(Constants::Uncrustify::DISPLAY_NAME));
|
||||
|
||||
m_formatFile = new QAction(BeautifierPlugin::msgFormatCurrentFile(), this);
|
||||
Core::Command *cmd
|
||||
@@ -114,7 +114,7 @@ void Uncrustify::formatFile()
|
||||
const QString cfgFileName = configurationFile();
|
||||
if (cfgFileName.isEmpty()) {
|
||||
BeautifierPlugin::showError(BeautifierPlugin::msgCannotGetConfigurationFile(
|
||||
Constants::Uncrustify::DISPLAY_NAME));
|
||||
tr(Constants::Uncrustify::DISPLAY_NAME)));
|
||||
} else {
|
||||
m_beautifierPlugin->formatCurrentFile(command(cfgFileName));
|
||||
}
|
||||
@@ -125,7 +125,7 @@ void Uncrustify::formatSelectedText()
|
||||
const QString cfgFileName = configurationFile();
|
||||
if (cfgFileName.isEmpty()) {
|
||||
BeautifierPlugin::showError(BeautifierPlugin::msgCannotGetConfigurationFile(
|
||||
Constants::Uncrustify::DISPLAY_NAME));
|
||||
tr(Constants::Uncrustify::DISPLAY_NAME)));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -25,11 +25,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
namespace Beautifier {
|
||||
namespace Constants {
|
||||
namespace Uncrustify {
|
||||
|
||||
const char DISPLAY_NAME[] = "Uncrustify";
|
||||
const char DISPLAY_NAME[] = QT_TRANSLATE_NOOP("Beautifier::Internal::Uncrustify::Uncrustify", "Uncrustify");
|
||||
const char ACTION_FORMATFILE[] = "Uncrustify.FormatFile";
|
||||
const char ACTION_FORMATSELECTED[] = "Uncrustify.FormatSelectedText";
|
||||
const char MENU_ID[] = "Uncrustify.Menu";
|
||||
|
@@ -28,6 +28,7 @@
|
||||
|
||||
#include "uncrustifyconstants.h"
|
||||
#include "uncrustifysettings.h"
|
||||
#include "uncrustify.h"
|
||||
|
||||
#include "../beautifierconstants.h"
|
||||
#include "../beautifierplugin.h"
|
||||
@@ -51,7 +52,7 @@ UncrustifyOptionsPageWidget::UncrustifyOptionsPageWidget(UncrustifySettings *set
|
||||
"HOME", QDir::toNativeSeparators(QDir::home().absolutePath())));
|
||||
ui->command->setExpectedKind(Utils::PathChooser::ExistingCommand);
|
||||
ui->command->setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle(
|
||||
Constants::Uncrustify::DISPLAY_NAME));
|
||||
Uncrustify::tr(Constants::Uncrustify::DISPLAY_NAME)));
|
||||
connect(ui->command, &Utils::PathChooser::validChanged, ui->options, &QWidget::setEnabled);
|
||||
ui->configurations->setSettings(m_settings);
|
||||
}
|
||||
|
Reference in New Issue
Block a user