add missing tr()s, etc., add some //: comments

This commit is contained in:
Oswald Buddenhagen
2009-04-17 21:11:52 +02:00
parent 9db13e3255
commit 6d5eeb7afb
35 changed files with 102 additions and 97 deletions
+2 -2
View File
@@ -226,8 +226,8 @@ BookmarkView::~BookmarkView()
void BookmarkView::contextMenuEvent(QContextMenuEvent *event) void BookmarkView::contextMenuEvent(QContextMenuEvent *event)
{ {
QMenu menu; QMenu menu;
QAction *remove = menu.addAction("&Remove Bookmark"); QAction *remove = menu.addAction(tr("&Remove Bookmark"));
QAction *removeAll = menu.addAction("Remove all Bookmarks"); QAction *removeAll = menu.addAction(tr("Remove all Bookmarks"));
m_contextMenuIndex = indexAt(event->pos()); m_contextMenuIndex = indexAt(event->pos());
if (!m_contextMenuIndex.isValid()) if (!m_contextMenuIndex.isValid())
remove->setEnabled(false); remove->setEnabled(false);
+1 -1
View File
@@ -162,7 +162,7 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
addAutoReleasedObject(new BookmarkViewFactory(m_bookmarkManager)); addAutoReleasedObject(new BookmarkViewFactory(m_bookmarkManager));
m_bookmarkMarginAction = new QAction(this); m_bookmarkMarginAction = new QAction(this);
m_bookmarkMarginAction->setText("Toggle Bookmark"); m_bookmarkMarginAction->setText(tr("Toggle Bookmark"));
//m_bookmarkAction->setIcon(QIcon(":/gdbdebugger/images/breakpoint.svg")); //m_bookmarkAction->setIcon(QIcon(":/gdbdebugger/images/breakpoint.svg"));
connect(m_bookmarkMarginAction, SIGNAL(triggered()), connect(m_bookmarkMarginAction, SIGNAL(triggered()),
this, SLOT(bookmarkMarginActionTriggered())); this, SLOT(bookmarkMarginActionTriggered()));
@@ -207,7 +207,7 @@ ShadowBuildPage::ShadowBuildPage(CMakeOpenProjectWizard *cmakeWizard)
m_pc = new Core::Utils::PathChooser(this); m_pc = new Core::Utils::PathChooser(this);
m_pc->setPath(m_cmakeWizard->buildDirectory()); m_pc->setPath(m_cmakeWizard->buildDirectory());
connect(m_pc, SIGNAL(changed()), this, SLOT(buildDirectoryChanged())); connect(m_pc, SIGNAL(changed()), this, SLOT(buildDirectoryChanged()));
fl->addRow("Build directory:", m_pc); fl->addRow(tr("Build directory:"), m_pc);
} }
void ShadowBuildPage::buildDirectoryChanged() void ShadowBuildPage::buildDirectoryChanged()
@@ -610,7 +610,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeProject *project)
// and then cmake builds in that directory instead of shadow building // and then cmake builds in that directory instead of shadow building
// We need our own generator for that to work // We need our own generator for that to work
connect(m_pathChooser, SIGNAL(changed()), this, SLOT(buildDirectoryChanged())); connect(m_pathChooser, SIGNAL(changed()), this, SLOT(buildDirectoryChanged()));
fl->addRow("Build directory:", m_pathChooser); fl->addRow(tr("Build directory:"), m_pathChooser);
} }
QString CMakeBuildSettingsWidget::displayName() const QString CMakeBuildSettingsWidget::displayName() const
+2 -2
View File
@@ -256,12 +256,12 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
setLayout(fl); setLayout(fl);
m_additionalArguments = new QLineEdit(this); m_additionalArguments = new QLineEdit(this);
fl->addRow("Additional arguments:", m_additionalArguments); fl->addRow(tr("Additional arguments:"), m_additionalArguments);
connect(m_additionalArguments, SIGNAL(textEdited(const QString &)), this, SLOT(additionalArgumentsEdited())); connect(m_additionalArguments, SIGNAL(textEdited(const QString &)), this, SLOT(additionalArgumentsEdited()));
m_targetsList = new QListWidget; m_targetsList = new QListWidget;
fl->addRow("Targets:", m_targetsList); fl->addRow(tr("Targets:"), m_targetsList);
// TODO update this list also on rescans of the CMakeLists.txt // TODO update this list also on rescans of the CMakeLists.txt
CMakeProject *pro = m_makeStep->project(); CMakeProject *pro = m_makeStep->project();
+5 -4
View File
@@ -100,12 +100,13 @@ WelcomeModePrivate::WelcomeModePrivate() :
#if defined(QT_NO_WEBKIT) #if defined(QT_NO_WEBKIT)
const char *LABEL = "<center><table><tr><td><img src=\":/core/html/images/product_logo.png\"/></td><td width=300>" const char LABEL[] = Q_TRANSLATE_NOOP("Core::Internal::WelcomeMode",
"<center><table><tr><td><img src=\":/core/html/images/product_logo.png\"/></td><td width=300>"
"<h2><br/><br/>Welcome</h2><p> Qt Creator is an intuitive, modern cross platform IDE that enables " "<h2><br/><br/>Welcome</h2><p> Qt Creator is an intuitive, modern cross platform IDE that enables "
"developers to create graphically appealing applications for desktop, " "developers to create graphically appealing applications for desktop, "
"embedded, and mobile devices. " "embedded, and mobile devices. "
"<p><font color=\"red\">(This startup page lacks features due to disabled webkit support)</font>" "<p><font color=\"red\">(This startup page lacks features due to disabled WebKit support)</font>"
"</td></tr></table>"; "</td></tr></table>");
#endif #endif
// --- WelcomePageData // --- WelcomePageData
@@ -157,7 +158,7 @@ WelcomeMode::WelcomeMode() :
#else #else
m_d->m_label->setWordWrap(true); m_d->m_label->setWordWrap(true);
m_d->m_label->setAlignment(Qt::AlignCenter); m_d->m_label->setAlignment(Qt::AlignCenter);
m_d->m_label->setText(LABEL); m_d->m_label->setText(tr(LABEL));
l->addWidget(m_d->m_label); l->addWidget(m_d->m_label);
#endif #endif
} }
+5 -5
View File
@@ -208,7 +208,7 @@ void CodepasterPlugin::fetch()
Ui_PasteSelectDialog ui; Ui_PasteSelectDialog ui;
ui.setupUi(&dialog); ui.setupUi(&dialog);
ui.listWidget->addItems(QStringList() << "Waiting for items"); ui.listWidget->addItems(QStringList() << tr("Waiting for items"));
ui.listWidget->setSelectionMode(QAbstractItemView::ExtendedSelection); ui.listWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
ui.listWidget->setFrameStyle(QFrame::NoFrame); ui.listWidget->setFrameStyle(QFrame::NoFrame);
m_fetcher->list(ui.listWidget); m_fetcher->list(ui.listWidget);
@@ -245,15 +245,15 @@ void CustomFetcher::customRequestFinished(int, bool error)
{ {
m_customError = error; m_customError = error;
if (m_customError || hadError()) { if (m_customError || hadError()) {
QMessageBox::warning(0, QLatin1String("CodePaster Error") QMessageBox::warning(0, tr("CodePaster Error")
, QLatin1String("Could not fetch code") , tr("Could not fetch code")
, QMessageBox::Ok); , QMessageBox::Ok);
return; return;
} }
QByteArray data = body(); QByteArray data = body();
if (!m_listWidget) { if (!m_listWidget) {
QString title = QString::fromLatin1("Code Paster: %1").arg(m_id); QString title = QString::fromLatin1("CodePaster: %1").arg(m_id);
EditorManager::instance()->newFile(Core::Constants::K_DEFAULT_TEXT_EDITOR, &title, data); EditorManager::instance()->newFile(Core::Constants::K_DEFAULT_TEXT_EDITOR, &title, data);
} else { } else {
m_listWidget->clear(); m_listWidget->clear();
@@ -295,7 +295,7 @@ void CustomPoster::customRequestFinished(int, bool error)
QApplication::clipboard()->setText(pastedUrl()); QApplication::clipboard()->setText(pastedUrl());
ICore::instance()->messageManager()->printToOutputPane(pastedUrl(), m_output); ICore::instance()->messageManager()->printToOutputPane(pastedUrl(), m_output);
} else } else
QMessageBox::warning(0, "Code Paster Error", "Some error occured while posting", QMessageBox::Ok); QMessageBox::warning(0, tr("CodePaster Error"), tr("Some error occured while posting"), QMessageBox::Ok);
#if 0 // Figure out how to access #if 0 // Figure out how to access
Core::Internal::MessageOutputWindow* messageWindow = Core::Internal::MessageOutputWindow* messageWindow =
ExtensionSystem::PluginManager::instance()->getObject<Core::Internal::MessageOutputWindow>(); ExtensionSystem::PluginManager::instance()->getObject<Core::Internal::MessageOutputWindow>();
+3 -4
View File
@@ -68,6 +68,7 @@
#include <Lexer.h> #include <Lexer.h>
#include <Token.h> #include <Token.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug> #include <QtCore/QDebug>
#include <QtCore/QMutexLocker> #include <QtCore/QMutexLocker>
#include <QtCore/QTime> #include <QtCore/QTime>
@@ -470,10 +471,8 @@ void CppPreprocessor::sourceNeeded(QString &fileName, IncludeType type,
m_currentDoc->addIncludeFile(fileName, line); m_currentDoc->addIncludeFile(fileName, line);
if (contents.isEmpty() && ! QFileInfo(fileName).isAbsolute()) { if (contents.isEmpty() && ! QFileInfo(fileName).isAbsolute()) {
QString msg; QString msg = QCoreApplication::translate(
"CppPreprocessor", "%1: No such file or directory").arg(fileName);
msg += fileName;
msg += QLatin1String(": No such file or directory");
Document::DiagnosticMessage d(Document::DiagnosticMessage::Warning, Document::DiagnosticMessage d(Document::DiagnosticMessage::Warning,
m_currentDoc->fileName(), m_currentDoc->fileName(),
@@ -67,14 +67,14 @@ public:
: QPlainTextEdit(parent) : QPlainTextEdit(parent)
{ {
m_clearContentsAction = new QAction(this); m_clearContentsAction = new QAction(this);
m_clearContentsAction->setText("Clear contents"); m_clearContentsAction->setText(tr("Clear contents"));
m_clearContentsAction->setEnabled(true); m_clearContentsAction->setEnabled(true);
m_clearContentsAction->setShortcut(Qt::ControlModifier + Qt::Key_R); m_clearContentsAction->setShortcut(Qt::ControlModifier + Qt::Key_R);
connect(m_clearContentsAction, SIGNAL(triggered(bool)), connect(m_clearContentsAction, SIGNAL(triggered(bool)),
parent, SLOT(clearContents())); parent, SLOT(clearContents()));
m_saveContentsAction = new QAction(this); m_saveContentsAction = new QAction(this);
m_saveContentsAction->setText("Save contents"); m_saveContentsAction->setText(tr("Save contents"));
m_saveContentsAction->setEnabled(true); m_saveContentsAction->setEnabled(true);
} }
@@ -149,7 +149,7 @@ private:
void focusInEvent(QFocusEvent *ev) void focusInEvent(QFocusEvent *ev)
{ {
emit statusMessageRequested("Type Ctrl-<Return> to execute a line.", -1); emit statusMessageRequested(tr("Type Ctrl-<Return> to execute a line."), -1);
QPlainTextEdit::focusInEvent(ev); QPlainTextEdit::focusInEvent(ev);
} }
+6 -6
View File
@@ -2817,7 +2817,7 @@ void GdbEngine::setToolTipExpression(const QPoint &pos, const QString &exp0)
return; return;
if (exp.startsWith('"') && exp.endsWith('"')) { if (exp.startsWith('"') && exp.endsWith('"')) {
QToolTip::showText(m_toolTipPos, "String literal " + exp); QToolTip::showText(m_toolTipPos, tr("String literal %1").arg(exp));
return; return;
} }
@@ -3713,7 +3713,7 @@ void GdbEngine::handleDebuggingHelperValue3(const GdbResultRecord &record,
//qDebug() << "RECEIVED" << record.toString() << " FOR " << data0.toString() //qDebug() << "RECEIVED" << record.toString() << " FOR " << data0.toString()
// << " STREAM: " << out; // << " STREAM: " << out;
if (list.isEmpty()) { if (list.isEmpty()) {
data.setValue("<unavailable>"); data.setValue(tr("<unavailable>"));
data.setAllUnneeded(); data.setAllUnneeded();
insertData(data); insertData(data);
} else if (data.type == "QString" || data.type.endsWith("::QString")) { } else if (data.type == "QString" || data.type.endsWith("::QString")) {
@@ -3746,7 +3746,7 @@ void GdbEngine::handleDebuggingHelperValue3(const GdbResultRecord &record,
sendSynchronizedCommand(cmd, WatchDebuggingHelperValue3, var); sendSynchronizedCommand(cmd, WatchDebuggingHelperValue3, var);
} }
} else { } else {
data.setValue("<unavailable>"); data.setValue(tr("<unavailable>"));
data.setAllUnneeded(); data.setAllUnneeded();
insertData(data); insertData(data);
} }
@@ -3840,7 +3840,7 @@ void GdbEngine::setLocals(const QList<GdbMi> &locals)
seen[name] = n + 1; seen[name] = n + 1;
WatchData data; WatchData data;
data.iname = "local." + name + QString::number(n + 1); data.iname = "local." + name + QString::number(n + 1);
data.name = name + QString(" <shadowed %1>").arg(n); data.name = tr("%1 <shadowed %2>").arg(name, n);
//data.setValue("<shadowed>"); //data.setValue("<shadowed>");
setWatchDataValue(data, item.findChild("value")); setWatchDataValue(data, item.findChild("value"));
data.setType("<shadowed>"); data.setType("<shadowed>");
@@ -3999,7 +3999,7 @@ void GdbEngine::handleVarListChildrenHelper(const GdbMi &item,
} else if (exp.isEmpty()) { } else if (exp.isEmpty()) {
// Happens with anonymous unions // Happens with anonymous unions
data.exp = parent.exp; data.exp = parent.exp;
data.name = "<n/a>"; data.name = tr("<n/a>");
data.iname = parent.iname + ".@"; data.iname = parent.iname + ".@";
data.type = "<anonymous union>"; data.type = "<anonymous union>";
} else { } else {
@@ -4054,7 +4054,7 @@ void GdbEngine::handleVarListChildren(const GdbResultRecord &record,
} else if (record.resultClass == GdbResultError) { } else if (record.resultClass == GdbResultError) {
data.setError(record.data.findChild("msg").data()); data.setError(record.data.findChild("msg").data());
} else { } else {
data.setError("Unknown error: " + record.toString()); data.setError(tr("Unknown error: ") + record.toString());
} }
} }
+2 -3
View File
@@ -473,13 +473,12 @@ void ScriptEngine::setToolTipExpression(const QPoint &pos, const QString &exp0)
} }
if (!hasLetterOrNumber(exp)) { if (!hasLetterOrNumber(exp)) {
QToolTip::showText(m_toolTipPos, QToolTip::showText(m_toolTipPos, tr("'%1' contains no identifier").arg(exp));
"'" + exp + "' contains no identifier");
return; return;
} }
if (exp.startsWith('"') && exp.endsWith('"')) { if (exp.startsWith('"') && exp.endsWith('"')) {
QToolTip::showText(m_toolTipPos, "String literal " + exp); QToolTip::showText(m_toolTipPos, tr("String literal %1").arg(exp));
return; return;
} }
+9 -6
View File
@@ -103,12 +103,15 @@ QVariant StackHandler::data(const QModelIndex &index, int role) const
return frame.address; return frame.address;
} }
} else if (role == Qt::ToolTipRole) { } else if (role == Qt::ToolTipRole) {
return "<table><tr><td>Address:</td><td>" + frame.address + "</td></tr>" //: Tooltip for variable
+ "<tr><td>Function: </td><td>" + frame.function + "</td></tr>" return tr("<table><tr><td>Address:</td><td>%1</td></tr>"
+ "<tr><td>File: </td><td>" + frame.file + "</td></tr>" "<tr><td>Function: </td><td>%2</td></tr>"
+ "<tr><td>Line: </td><td>" + QString::number(frame.line) + "</td></tr>" "<tr><td>File: </td><td>%3</td></tr>"
+ "<tr><td>From: </td><td>" + frame.from + "</td></tr></table>" "<tr><td>Line: </td><td>%4</td></tr>"
+ "<tr><td>To: </td><td>" + frame.to + "</td></tr></table>"; "<tr><td>From: </td><td>%5</td></tr></table>"
"<tr><td>To: </td><td>%6</td></tr></table>")
.arg(frame.address, frame.function,
frame.file, QString::number(frame.line), frame.from, frame.to);
} else if (role == Qt::DecorationRole && index.column() == 0) { } else if (role == Qt::DecorationRole && index.column() == 0) {
// Return icon that indicates whether this is the active stack frame // Return icon that indicates whether this is the active stack frame
return (index.row() == m_currentIndex) ? m_positionIcon : m_emptyIcon; return (index.row() == m_currentIndex) ? m_positionIcon : m_emptyIcon;
+2 -1
View File
@@ -64,7 +64,8 @@
using namespace Debugger::Internal; using namespace Debugger::Internal;
static const QString strNotInScope = QLatin1String("<not in scope>"); static const QString strNotInScope =
QCoreApplication::translate("Debugger::Internal::WatchData", "<not in scope>");
static int watcherCounter = 0; static int watcherCounter = 0;
+4 -4
View File
@@ -360,22 +360,22 @@ void FormEditorW::setupActions()
m_toolActionIds.push_back(QLatin1String("FormEditor.WidgetEditor")); m_toolActionIds.push_back(QLatin1String("FormEditor.WidgetEditor"));
createEditModeAction(m_actionGroupEditMode, globalcontext, am, medit, createEditModeAction(m_actionGroupEditMode, globalcontext, am, medit,
QLatin1String("Edit widgets"), m_toolActionIds.back(), tr("Edit widgets"), m_toolActionIds.back(),
EditModeWidgetEditor, QLatin1String("widgettool.png"), tr("F3")); EditModeWidgetEditor, QLatin1String("widgettool.png"), tr("F3"));
m_toolActionIds.push_back(QLatin1String("FormEditor.SignalsSlotsEditor")); m_toolActionIds.push_back(QLatin1String("FormEditor.SignalsSlotsEditor"));
createEditModeAction(m_actionGroupEditMode, globalcontext, am, medit, createEditModeAction(m_actionGroupEditMode, globalcontext, am, medit,
QLatin1String("Edit signals/slots"), m_toolActionIds.back(), tr("Edit signals/slots"), m_toolActionIds.back(),
EditModeSignalsSlotEditor, QLatin1String("signalslottool.png"), tr("F4")); EditModeSignalsSlotEditor, QLatin1String("signalslottool.png"), tr("F4"));
m_toolActionIds.push_back(QLatin1String("FormEditor.BuddyEditor")); m_toolActionIds.push_back(QLatin1String("FormEditor.BuddyEditor"));
createEditModeAction(m_actionGroupEditMode, globalcontext, am, medit, createEditModeAction(m_actionGroupEditMode, globalcontext, am, medit,
QLatin1String("Edit buddies"), m_toolActionIds.back(), tr("Edit buddies"), m_toolActionIds.back(),
EditModeBuddyEditor, QLatin1String("buddytool.png")); EditModeBuddyEditor, QLatin1String("buddytool.png"));
m_toolActionIds.push_back(QLatin1String("FormEditor.TabOrderEditor")); m_toolActionIds.push_back(QLatin1String("FormEditor.TabOrderEditor"));
createEditModeAction(m_actionGroupEditMode, globalcontext, am, medit, createEditModeAction(m_actionGroupEditMode, globalcontext, am, medit,
QLatin1String("Edit tab order"), m_toolActionIds.back(), tr("Edit tab order"), m_toolActionIds.back(),
EditModeTabOrderEditor, QLatin1String("tabordertool.png")); EditModeTabOrderEditor, QLatin1String("tabordertool.png"));
//tool actions //tool actions
+4 -4
View File
@@ -848,7 +848,7 @@ void FakeVimHandler::Private::showBlackMessage(const QString &msg)
void FakeVimHandler::Private::notImplementedYet() void FakeVimHandler::Private::notImplementedYet()
{ {
qDebug() << "Not implemented in FakeVim"; qDebug() << "Not implemented in FakeVim";
showRedMessage("Not implemented in FakeVim"); showRedMessage(tr("Not implemented in FakeVim"));
updateMiniBuffer(); updateMiniBuffer();
} }
@@ -1976,13 +1976,13 @@ void FakeVimHandler::Private::search(const QString &needle0, bool forward)
if (oldLine != cursorLineInDocument() - cursorLineOnScreen()) if (oldLine != cursorLineInDocument() - cursorLineOnScreen())
scrollToLineInDocument(cursorLineInDocument() - linesOnScreen() / 2); scrollToLineInDocument(cursorLineInDocument() - linesOnScreen() / 2);
if (forward) if (forward)
showRedMessage("search hit BOTTOM, continuing at TOP"); showRedMessage(tr("search hit BOTTOM, continuing at TOP"));
else else
showRedMessage("search hit TOP, continuing at BOTTOM"); showRedMessage(tr("search hit TOP, continuing at BOTTOM"));
highlightMatches(needle); highlightMatches(needle);
} else { } else {
m_tc = orig; m_tc = orig;
showRedMessage("E486: Pattern not found: " + needle); showRedMessage(tr("E486: Pattern not found: ") + needle);
highlightMatches(QString()); highlightMatches(QString());
} }
} }
+3 -3
View File
@@ -46,7 +46,7 @@ void ChangeSelectionDialog::selectWorkingDirectory()
{ {
static QString location = QString(); static QString location = QString();
location = QFileDialog::getExistingDirectory(this, location = QFileDialog::getExistingDirectory(this,
QLatin1String("Select Git repository"), tr("Select Git repository"),
location); location);
if (location.isEmpty()) if (location.isEmpty())
return; return;
@@ -63,7 +63,7 @@ void ChangeSelectionDialog::selectWorkingDirectory()
} while (repository.cdUp()); } while (repository.cdUp());
// Did not find a repo // Did not find a repo
QMessageBox::critical(this, QLatin1String("Error"), QMessageBox::critical(this, tr("Error"),
QLatin1String("Selected directory is not a Git repository")); tr("Selected directory is not a Git repository"));
} }
+1
View File
@@ -89,6 +89,7 @@ static inline QString msgParseFilesFailed()
static QString formatCommand(const QString &binary, const QStringList &args) static QString formatCommand(const QString &binary, const QStringList &args)
{ {
const QString timeStamp = QTime::currentTime().toString(QLatin1String("HH:mm")); const QString timeStamp = QTime::currentTime().toString(QLatin1String("HH:mm"));
//: <timestamp> Executing: <executable> <arguments>
return GitClient::tr("%1 Executing: %2 %3\n").arg(timeStamp, binary, args.join(QString(QLatin1Char(' ')))); return GitClient::tr("%1 Executing: %2 %3\n").arg(timeStamp, binary, args.join(QString(QLatin1Char(' '))));
} }
+3 -3
View File
@@ -376,7 +376,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
gitContainer->addAction(createSeparator(actionManager, globalcontext, QLatin1String("Git.Sep.Global"), this)); gitContainer->addAction(createSeparator(actionManager, globalcontext, QLatin1String("Git.Sep.Global"), this));
m_stashAction = new QAction(tr("Stash"), this); m_stashAction = new QAction(tr("Stash"), this);
m_stashAction->setToolTip("Saves the current state of your work."); m_stashAction->setToolTip(tr("Saves the current state of your work."));
command = actionManager->registerAction(m_stashAction, "Git.Stash", globalcontext); command = actionManager->registerAction(m_stashAction, "Git.Stash", globalcontext);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_stashAction, SIGNAL(triggered()), this, SLOT(stash())); connect(m_stashAction, SIGNAL(triggered()), this, SLOT(stash()));
@@ -389,7 +389,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
gitContainer->addAction(command); gitContainer->addAction(command);
m_stashPopAction = new QAction(tr("Stash Pop"), this); m_stashPopAction = new QAction(tr("Stash Pop"), this);
m_stashAction->setToolTip("Restores changes saved to the stash list using \"Stash\"."); m_stashAction->setToolTip(tr("Restores changes saved to the stash list using \"Stash\"."));
command = actionManager->registerAction(m_stashPopAction, "Git.StashPop", globalcontext); command = actionManager->registerAction(m_stashPopAction, "Git.StashPop", globalcontext);
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_stashPopAction, SIGNAL(triggered()), this, SLOT(stashPop())); connect(m_stashPopAction, SIGNAL(triggered()), this, SLOT(stashPop()));
@@ -785,7 +785,7 @@ void GitPlugin::updateActions()
const QString repository = m_gitClient->findRepositoryForFile(current.absoluteFilePath()); const QString repository = m_gitClient->findRepositoryForFile(current.absoluteFilePath());
// First check for file commands and if the current file is inside // First check for file commands and if the current file is inside
// a Git-repository // a Git-repository
const QString file = fileName.isEmpty() ? "File" : "File \"" + fileName + '"'; const QString file = fileName.isEmpty() ? tr("File") : "\"" + fileName + '"';
m_diffAction->setText(tr("Diff %1").arg(file)); m_diffAction->setText(tr("Diff %1").arg(file));
m_statusAction->setText(tr("Status Related to %1").arg(file)); m_statusAction->setText(tr("Status Related to %1").arg(file));
m_logAction->setText(tr("Log of %1").arg(file)); m_logAction->setText(tr("Log of %1").arg(file));
+2 -2
View File
@@ -82,7 +82,7 @@ bool HelloWorldPlugin::initialize(const QStringList &arguments, QString *error_m
QLatin1String("HelloWorld.MainView")); QLatin1String("HelloWorld.MainView"));
// Create an action to be triggered by a menu entry // Create an action to be triggered by a menu entry
QAction *helloWorldAction = new QAction("Say \"&Hello World!\"", this); QAction *helloWorldAction = new QAction(tr("Say \"&Hello World!\""), this);
connect(helloWorldAction, SIGNAL(triggered()), SLOT(sayHelloWorld())); connect(helloWorldAction, SIGNAL(triggered()), SLOT(sayHelloWorld()));
// Register the action with the action manager // Register the action with the action manager
@@ -143,7 +143,7 @@ void HelloWorldPlugin::sayHelloWorld()
// When passing 0 for the parent, the message box becomes an // When passing 0 for the parent, the message box becomes an
// application-global modal dialog box // application-global modal dialog box
QMessageBox::information( QMessageBox::information(
0, "Hello World!", "Hello World! Beautiful day today, isn't it?"); 0, tr("Hello World!"), tr("Hello World! Beautiful day today, isn't it?"));
} }
Q_EXPORT_PLUGIN(HelloWorldPlugin) Q_EXPORT_PLUGIN(HelloWorldPlugin)
+1 -1
View File
@@ -38,6 +38,6 @@ HelloWorldWindow::HelloWorldWindow(QWidget *parent)
: QWidget(parent) : QWidget(parent)
{ {
QBoxLayout *layout = new QVBoxLayout(this); QBoxLayout *layout = new QVBoxLayout(this);
layout->addWidget(new QTextEdit("Focus me to activate my context!")); layout->addWidget(new QTextEdit(tr("Focus me to activate my context!")));
setWindowTitle(tr("Hello, world!")); setWindowTitle(tr("Hello, world!"));
} }
+2 -2
View File
@@ -604,8 +604,8 @@ void HelpPlugin::activateContext()
if (viewer) { if (viewer) {
viewer->setSource(QUrl()); viewer->setSource(QUrl());
viewer->setHtml("<html><head><title>No Documentation</title></head><body><br/><br/><center>No" viewer->setHtml(tr("<html><head><title>No Documentation</title></head><body><br/><br/><center>No"
" documentation available.</center></body></html>"); " documentation available.</center></body></html>"));
//activateIndex(); //activateIndex();
} }
} }
@@ -67,19 +67,19 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE
layout->setMargin(0); layout->setMargin(0);
m_userName = new QLineEdit(this); m_userName = new QLineEdit(this);
layout->addRow("Name:", m_userName); layout->addRow(tr("Name:"), m_userName);
m_executableChooser = new Core::Utils::PathChooser(this); m_executableChooser = new Core::Utils::PathChooser(this);
m_executableChooser->setExpectedKind(Core::Utils::PathChooser::Command); m_executableChooser->setExpectedKind(Core::Utils::PathChooser::Command);
layout->addRow("Executable:", m_executableChooser); layout->addRow(tr("Executable:"), m_executableChooser);
m_commandLineArgumentsLineEdit = new QLineEdit(this); m_commandLineArgumentsLineEdit = new QLineEdit(this);
m_commandLineArgumentsLineEdit->setMinimumWidth(200); // this shouldn't be fixed here... m_commandLineArgumentsLineEdit->setMinimumWidth(200); // this shouldn't be fixed here...
layout->addRow("Arguments:", m_commandLineArgumentsLineEdit); layout->addRow(tr("Arguments:"), m_commandLineArgumentsLineEdit);
m_workingDirectory = new CustomDirectoryPathChooser(this); m_workingDirectory = new CustomDirectoryPathChooser(this);
m_workingDirectory->setExpectedKind(Core::Utils::PathChooser::Directory); m_workingDirectory->setExpectedKind(Core::Utils::PathChooser::Directory);
layout->addRow("Working Directory:", m_workingDirectory); layout->addRow(tr("Working Directory:"), m_workingDirectory);
m_useTerminalCheck = new QCheckBox(tr("Run in &Terminal"), this); m_useTerminalCheck = new QCheckBox(tr("Run in &Terminal"), this);
layout->addRow(QString(), m_useTerminalCheck); layout->addRow(QString(), m_useTerminalCheck);
@@ -153,7 +153,7 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Project *pro)
m_userSetName(false) m_userSetName(false)
{ {
m_workingDirectory = "$BUILDDIR"; m_workingDirectory = "$BUILDDIR";
setName("Custom Executable"); setName(tr("Custom Executable"));
} }
CustomExecutableRunConfiguration::~CustomExecutableRunConfiguration() CustomExecutableRunConfiguration::~CustomExecutableRunConfiguration()
@@ -190,7 +190,7 @@ QString CustomExecutableRunConfiguration::executable() const
QWidget *confWidget = const_cast<CustomExecutableRunConfiguration *>(this)->configurationWidget(); QWidget *confWidget = const_cast<CustomExecutableRunConfiguration *>(this)->configurationWidget();
QDialog dialog; QDialog dialog;
dialog.setLayout(new QVBoxLayout()); dialog.setLayout(new QVBoxLayout());
dialog.layout()->addWidget(new QLabel("Could not find the executable, please specify one.")); dialog.layout()->addWidget(new QLabel(tr("Could not find the executable, please specify one.")));
dialog.layout()->addWidget(confWidget); dialog.layout()->addWidget(confWidget);
QDialogButtonBox *dbb = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); QDialogButtonBox *dbb = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(dbb, SIGNAL(accepted()), &dialog, SLOT(accept())); connect(dbb, SIGNAL(accepted()), &dialog, SLOT(accept()));
@@ -338,7 +338,7 @@ QSharedPointer<RunConfiguration> CustomExecutableRunConfigurationFactory::create
{ {
if (type == "ProjectExplorer.CustomExecutableRunConfiguration") { if (type == "ProjectExplorer.CustomExecutableRunConfiguration") {
QSharedPointer<RunConfiguration> rc(new CustomExecutableRunConfiguration(project)); QSharedPointer<RunConfiguration> rc(new CustomExecutableRunConfiguration(project));
rc->setName("Custom Executable"); rc->setName(tr("Custom Executable"));
return rc; return rc;
} else { } else {
return QSharedPointer<RunConfiguration>(0); return QSharedPointer<RunConfiguration>(0);
@@ -354,7 +354,7 @@ QStringList CustomExecutableRunConfigurationFactory::canCreate(Project *pro) con
QString CustomExecutableRunConfigurationFactory::nameForType(const QString &type) const QString CustomExecutableRunConfigurationFactory::nameForType(const QString &type) const
{ {
if (type == "ProjectExplorer.CustomExecutableRunConfiguration") if (type == "ProjectExplorer.CustomExecutableRunConfiguration")
return "Custom Executable"; return tr("Custom Executable");
else else
return QString::null; return QString();
} }
@@ -262,13 +262,13 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
// build menu // build menu
Core::ActionContainer *mbuild = Core::ActionContainer *mbuild =
am->createMenu(Constants::M_BUILDPROJECT); am->createMenu(Constants::M_BUILDPROJECT);
mbuild->menu()->setTitle("&Build"); mbuild->menu()->setTitle(tr("&Build"));
menubar->addMenu(mbuild, Core::Constants::G_VIEW); menubar->addMenu(mbuild, Core::Constants::G_VIEW);
// debug menu // debug menu
Core::ActionContainer *mdebug = Core::ActionContainer *mdebug =
am->createMenu(Constants::M_DEBUG); am->createMenu(Constants::M_DEBUG);
mdebug->menu()->setTitle("&Debug"); mdebug->menu()->setTitle(tr("&Debug"));
menubar->addMenu(mdebug, Core::Constants::G_VIEW); menubar->addMenu(mdebug, Core::Constants::G_VIEW);
@@ -428,7 +428,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
// recent projects menu // recent projects menu
Core::ActionContainer *mrecent = Core::ActionContainer *mrecent =
am->createMenu(Constants::M_RECENTPROJECTS); am->createMenu(Constants::M_RECENTPROJECTS);
mrecent->menu()->setTitle("Recent Projects"); mrecent->menu()->setTitle(tr("Recent Projects"));
mfile->addMenu(mrecent, Core::Constants::G_FILE_OPEN); mfile->addMenu(mrecent, Core::Constants::G_FILE_OPEN);
connect(mfile->menu(), SIGNAL(aboutToShow()), connect(mfile->menu(), SIGNAL(aboutToShow()),
this, SLOT(updateRecentProjectMenu())); this, SLOT(updateRecentProjectMenu()));
@@ -115,7 +115,8 @@ void ProjectWizardPage::setFilesDisplay(const QStringList &files)
QString fileMessage; QString fileMessage;
{ {
QTextStream str(&fileMessage); QTextStream str(&fileMessage);
str << "<html>Files to be added:<pre>"; str << "<qt>" << tr("Files to be added:");
str << "<pre>";
const QStringList::const_iterator cend = files.constEnd(); const QStringList::const_iterator cend = files.constEnd();
for (QStringList::const_iterator it = files.constBegin(); it != cend; ++it) for (QStringList::const_iterator it = files.constBegin(); it != cend; ++it)
str << *it << '\n'; str << *it << '\n';
@@ -85,9 +85,9 @@ private:
NewSessionInputDialog::NewSessionInputDialog(QStringList sessions) NewSessionInputDialog::NewSessionInputDialog(QStringList sessions)
{ {
setWindowTitle("New session name"); setWindowTitle(tr("New session name"));
QVBoxLayout *hlayout = new QVBoxLayout(this); QVBoxLayout *hlayout = new QVBoxLayout(this);
QLabel *label = new QLabel("Enter the name of the new session:", this); QLabel *label = new QLabel(tr("Enter the name of the new session:"), this);
hlayout->addWidget(label); hlayout->addWidget(label);
m_newSessionLineEdit = new QLineEdit(this); m_newSessionLineEdit = new QLineEdit(this);
m_newSessionLineEdit->setValidator(new SessionValidator(this, sessions)); m_newSessionLineEdit->setValidator(new SessionValidator(this, sessions));
@@ -183,7 +183,7 @@ void ProjectLoadWizard::setupImportPage(QtVersion *version, QtVersion::QmakeBuil
resize(605, 490); resize(605, 490);
// Import Page // Import Page
importPage = new QWizardPage(this); importPage = new QWizardPage(this);
importPage->setTitle("Import existing settings"); importPage->setTitle(tr("Import existing settings"));
QVBoxLayout *importLayout = new QVBoxLayout(importPage); QVBoxLayout *importLayout = new QVBoxLayout(importPage);
importLabel = new QLabel(importPage); importLabel = new QLabel(importPage);
@@ -201,13 +201,13 @@ void ProjectLoadWizard::setupImportPage(QtVersion *version, QtVersion::QmakeBuil
importCheckbox = new QCheckBox(importPage); importCheckbox = new QCheckBox(importPage);
importCheckbox->setText("Import existing build settings."); importCheckbox->setText(tr("Import existing build settings."));
importCheckbox->setChecked(true); importCheckbox->setChecked(true);
importLayout->addWidget(importCheckbox); importLayout->addWidget(importCheckbox);
import2Label = new QLabel(importPage); import2Label = new QLabel(importPage);
import2Label->setTextFormat(Qt::RichText); import2Label->setTextFormat(Qt::RichText);
if (m_temporaryVersion) if (m_temporaryVersion)
import2Label->setText(QString("<b>Note:</b> Importing the settings will automatically add the Qt Version from:<br><b>%1</b> to the list of qt versions.") import2Label->setText(tr("<b>Note:</b> Importing the settings will automatically add the Qt Version from:<br><b>%1</b> to the list of qt versions.")
.arg(m_importVersion->path())); .arg(m_importVersion->path()));
importLayout->addWidget(import2Label); importLayout->addWidget(import2Label);
addPage(importPage); addPage(importPage);
+2 -2
View File
@@ -116,8 +116,8 @@ bool QMakeStep::init(const QString &name)
Environment environment = m_pro->environment(name); Environment environment = m_pro->environment(name);
if (!environment.value("QMAKESPEC").isEmpty() && environment.value("QMAKESPEC") != qtVersion->mkspec()) if (!environment.value("QMAKESPEC").isEmpty() && environment.value("QMAKESPEC") != qtVersion->mkspec())
emit addToOutputWindow(tr("QMAKESPEC set to ") + environment.value("QMAKESPEC") + emit addToOutputWindow(tr("QMAKESPEC from environment (%1) overrides mkspec of selected Qt (%2).")
tr(" overrides mkspec of selected qt ")+qtVersion->mkspec()); .arg(environment.value("QMAKESPEC"), qtVersion->mkspec()));
QString program = qtVersion->qmakeCommand(); QString program = qtVersion->qmakeCommand();
@@ -355,7 +355,7 @@ void Qt4RunConfiguration::updateTarget()
if (!reader->readProFile(m_proFilePath)) { if (!reader->readProFile(m_proFilePath)) {
delete reader; delete reader;
Core::ICore::instance()->messageManager()->printToOutputPane(QString("Could not parse %1. The Qt4 run configuration %2 can not be started.").arg(m_proFilePath).arg(name())); Core::ICore::instance()->messageManager()->printToOutputPane(tr("Could not parse %1. The Qt4 run configuration %2 can not be started.").arg(m_proFilePath).arg(name()));
return; return;
} }
@@ -612,10 +612,9 @@ void QtDirWidget::showEnvironmentPage(QTreeWidgetItem *item)
} else { //ProjectExplorer::ToolChain::GCC } else { //ProjectExplorer::ToolChain::GCC
m_ui.msvcComboBox->setVisible(false); m_ui.msvcComboBox->setVisible(false);
makeMingwVisible(false); makeMingwVisible(false);
m_ui.errorLabel->setText("Found Qt version " m_ui.errorLabel->setText(tr("Found Qt version %1, using mkspec %2")
+ m_versions.at(index)->qtVersionString() .arg(m_versions.at(index)->qtVersionString(),
+ " using mkspec " m_versions.at(index)->mkspec()));
+ m_versions.at(index)->mkspec());
} }
} else { } else {
m_ui.msvcComboBox->setVisible(false); m_ui.msvcComboBox->setVisible(false);
@@ -1475,7 +1474,7 @@ QString QtVersion::buildDebuggingHelperLibrary()
break; break;
} }
output += QString("\nRuninng %1 ...\n").arg(qmakeCommand()); output += QString("\nRunning %1 ...\n").arg(qmakeCommand());
proc.start(qmakeCommand(), QStringList()<<"-spec"<< mkspec() <<"gdbmacros.pro"); proc.start(qmakeCommand(), QStringList()<<"-spec"<< mkspec() <<"gdbmacros.pro");
proc.waitForFinished(); proc.waitForFinished();
@@ -258,7 +258,7 @@ QuickOpenToolWindow::QuickOpenToolWindow(QuickOpenPlugin *qop) :
// Explicitly hide the completion list popup. // Explicitly hide the completion list popup.
m_completionList->hide(); m_completionList->hide();
setWindowTitle("Locate..."); setWindowTitle(tr("Locate..."));
resize(200, 90); resize(200, 90);
QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
sizePolicy.setHorizontalStretch(0); sizePolicy.setHorizontalStretch(0);
@@ -446,7 +446,7 @@ void QuickOpenToolWindow::show(const QString &text, int selectionStart, int sele
void QuickOpenToolWindow::filterSelected() void QuickOpenToolWindow::filterSelected()
{ {
QString searchText = "<type here>"; QString searchText = tr("<type here>");
QAction *action = qobject_cast<QAction*>(sender()); QAction *action = qobject_cast<QAction*>(sender());
QTC_ASSERT(action, return); QTC_ASSERT(action, return);
IQuickOpenFilter *filter = action->data().value<IQuickOpenFilter*>(); IQuickOpenFilter *filter = action->data().value<IQuickOpenFilter*>();
@@ -972,6 +972,7 @@ SubversionResponse SubversionPlugin::runSvn(const QStringList &arguments,
// Hide passwords, etc in the log window // Hide passwords, etc in the log window
const QString timeStamp = QTime::currentTime().toString(QLatin1String("HH:mm")); const QString timeStamp = QTime::currentTime().toString(QLatin1String("HH:mm"));
//: <timestamp> Executing: <executable> <arguments>
const QString outputText = tr("%1 Executing: %2 %3\n").arg(timeStamp, executable, SubversionSettings::formatArguments(allArgs)); const QString outputText = tr("%1 Executing: %2 %3\n").arg(timeStamp, executable, SubversionSettings::formatArguments(allArgs));
showOutput(outputText, false); showOutput(outputText, false);
+2 -2
View File
@@ -3722,8 +3722,8 @@ void BaseTextEditorEditable::updateCursorPosition()
const QTextBlock block = cursor.block(); const QTextBlock block = cursor.block();
const int line = block.blockNumber() + 1; const int line = block.blockNumber() + 1;
const int column = cursor.position() - block.position() + 1; const int column = cursor.position() - block.position() + 1;
m_cursorPositionLabel->setText(QString("Line: %1, Col: %2").arg(line).arg(column), m_cursorPositionLabel->setText(tr("Line: %1, Col: %2").arg(line).arg(column),
QString("Line: %1, Col: 999").arg(e->blockCount())); tr("Line: %1, Col: 999").arg(e->blockCount()));
m_contextHelpId.clear(); m_contextHelpId.clear();
if (!block.isVisible()) if (!block.isVisible())
+1 -1
View File
@@ -52,7 +52,7 @@ QList<FilterEntry> LineNumberFilter::matchesFor(const QString &entry)
QList<FilterEntry> value; QList<FilterEntry> value;
int line = entry.toInt(&ok); int line = entry.toInt(&ok);
if (line > 0 && currentTextEditor()) if (line > 0 && currentTextEditor())
value.append(FilterEntry(this, QString("Line %1").arg(line), QVariant(line))); value.append(FilterEntry(this, tr("Line %1").arg(line), QVariant(line)));
return value; return value;
} }
@@ -337,7 +337,7 @@ void TextEditorActionHandler::gotoAction()
QuickOpen::QuickOpenManager *quickopen = QuickOpen::QuickOpenManager::instance(); QuickOpen::QuickOpenManager *quickopen = QuickOpen::QuickOpenManager::instance();
QTC_ASSERT(quickopen, return); QTC_ASSERT(quickopen, return);
QString shortcut = TextEditorPlugin::instance()->lineNumberFilter()->shortcutString(); QString shortcut = TextEditorPlugin::instance()->lineNumberFilter()->shortcutString();
quickopen->show(shortcut + " <line number>", 2, 13); quickopen->show(shortcut + tr(" <line number>"), 2, 13);
} }
void TextEditorActionHandler::printAction() void TextEditorActionHandler::printAction()
+7 -7
View File
@@ -86,7 +86,7 @@ View::View(QWidget *parent)
delete m_ui.uiPatchView; delete m_ui.uiPatchView;
m_ui.uiPatchView = new ColumnIndicatorTextEdit(m_ui.groupBox); m_ui.uiPatchView = new ColumnIndicatorTextEdit(m_ui.groupBox);
m_ui.vboxLayout1->addWidget(m_ui.uiPatchView); m_ui.vboxLayout1->addWidget(m_ui.uiPatchView);
m_ui.buttonBox->button(QDialogButtonBox::Ok)->setText("Paste"); m_ui.buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Paste"));
connect(m_ui.uiPatchList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(contentChanged())); connect(m_ui.uiPatchList, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(contentChanged()));
} }
@@ -97,7 +97,7 @@ View::~View()
QString View::getUser() QString View::getUser()
{ {
const QString username = m_ui.uiUsername->text(); const QString username = m_ui.uiUsername->text();
if (username.isEmpty() || username == "<Username>") if (username.isEmpty() || username == tr("<Username>"))
return "Anonymous"; return "Anonymous";
return username; return username;
} }
@@ -105,7 +105,7 @@ QString View::getUser()
QString View::getDescription() QString View::getDescription()
{ {
const QString description = m_ui.uiDescription->text(); const QString description = m_ui.uiDescription->text();
if (description == "<Description>") if (description == tr("<Description>"))
return QString(); return QString();
return description; return description;
} }
@@ -113,7 +113,7 @@ QString View::getDescription()
QString View::getComment() QString View::getComment()
{ {
const QString comment = m_ui.uiComment->toPlainText(); const QString comment = m_ui.uiComment->toPlainText();
if (comment == "<Comment>") if (comment == tr("<Comment>"))
return QString(); return QString();
return comment; return comment;
} }
@@ -138,17 +138,17 @@ int View::show(const QString &user, const QString &description, const QString &c
const FileDataList &parts) const FileDataList &parts)
{ {
if (user.isEmpty()) if (user.isEmpty())
m_ui.uiUsername->setText("<Username>"); m_ui.uiUsername->setText(tr("<Username>"));
else else
m_ui.uiUsername->setText(user); m_ui.uiUsername->setText(user);
if (description.isEmpty()) if (description.isEmpty())
m_ui.uiDescription->setText("<Description>"); m_ui.uiDescription->setText(tr("<Description>"));
else else
m_ui.uiDescription->setText(description); m_ui.uiDescription->setText(description);
if (comment.isEmpty()) if (comment.isEmpty())
m_ui.uiComment->setPlainText("<Comment>"); m_ui.uiComment->setPlainText(tr("<Comment>"));
else else
m_ui.uiComment->setPlainText(comment); m_ui.uiComment->setPlainText(comment);