Commit 2f129dfa authored by Friedemann Kleint's avatar Friedemann Kleint

Fixed some translation errors.

parent afe68f0d
......@@ -71,7 +71,7 @@ bool ConsoleProcess::start(const QString &program, const QStringList &args)
QString err = stubServerListen();
if (!err.isEmpty()) {
emit processError(tr("Cannot set up comm channel: %1").arg(err));
emit processError(tr("Cannot set up communication channel: %1").arg(err));
return false;
}
......@@ -79,7 +79,7 @@ bool ConsoleProcess::start(const QString &program, const QStringList &args)
m_tempFile = new QTemporaryFile();
if (!m_tempFile->open()) {
stubServerShutdown();
emit processError(tr("Cannot create temp file: %1").arg(m_tempFile->errorString()));
emit processError(tr("Cannot create temporary file: %1").arg(m_tempFile->errorString()));
delete m_tempFile;
m_tempFile = 0;
return false;
......@@ -109,7 +109,7 @@ bool ConsoleProcess::start(const QString &program, const QStringList &args)
m_process.start(xterm, xtermArgs);
if (!m_process.waitForStarted()) {
stubServerShutdown();
emit processError(tr("Cannot start terminal emulator %1.").arg(xterm));
emit processError(tr("Cannot start the terminal emulator '%1'.").arg(xterm));
delete m_tempFile;
m_tempFile = 0;
return false;
......@@ -145,7 +145,7 @@ QString ConsoleProcess::stubServerListen()
{
QTemporaryFile tf;
if (!tf.open())
return tr("Cannot create temporary file: %2").arg(tf.errorString());
return tr("Cannot create temporary file: %1").arg(tf.errorString());
stubFifoDir = QFile::encodeName(tf.fileName());
}
// By now the temp file was deleted again
......@@ -153,12 +153,12 @@ QString ConsoleProcess::stubServerListen()
if (!::mkdir(m_stubServerDir.constData(), 0700))
break;
if (errno != EEXIST)
return tr("Cannot create temporary directory %1: %2").arg(stubFifoDir, strerror(errno));
return tr("Cannot create temporary directory '%1': %2").arg(stubFifoDir, strerror(errno));
}
QString stubServer = stubFifoDir + "/stub-socket";
if (!m_stubServer.listen(stubServer)) {
::rmdir(m_stubServerDir.constData());
return tr("Cannot create socket %1: %2").arg(stubServer, m_stubServer.errorString());
return tr("Cannot create socket '%1': %2").arg(stubServer, m_stubServer.errorString());
}
return QString();
}
......@@ -190,10 +190,10 @@ void ConsoleProcess::readStubOutput()
QByteArray out = m_stubSocket->readLine();
out.chop(1); // \n
if (out.startsWith("err:chdir ")) {
emit processError(tr("Cannot change to working directory %1: %2")
emit processError(tr("Cannot change to working directory '%1': %2")
.arg(workingDirectory(), errorMsg(out.mid(10).toInt())));
} else if (out.startsWith("err:exec ")) {
emit processError(tr("Cannot execute %1: %2")
emit processError(tr("Cannot execute '%1': %2")
.arg(m_executable, errorMsg(out.mid(9).toInt())));
} else if (out.startsWith("pid ")) {
// Will not need it any more
......
......@@ -69,7 +69,7 @@ bool ConsoleProcess::start(const QString &program, const QStringList &args)
QString err = stubServerListen();
if (!err.isEmpty()) {
emit processError(tr("Cannot set up comm channel: %1").arg(err));
emit processError(tr("Cannot set up communication channel: %1").arg(err));
return false;
}
......@@ -77,7 +77,7 @@ bool ConsoleProcess::start(const QString &program, const QStringList &args)
m_tempFile = new QTemporaryFile();
if (!m_tempFile->open()) {
stubServerShutdown();
emit processError(tr("Cannot create temp file: %1").arg(m_tempFile->errorString()));
emit processError(tr("Cannot create temporary file: %1").arg(m_tempFile->errorString()));
delete m_tempFile;
m_tempFile = 0;
return false;
......@@ -180,10 +180,10 @@ void ConsoleProcess::readStubOutput()
QByteArray out = m_stubSocket->readLine();
out.chop(2); // \r\n
if (out.startsWith("err:chdir ")) {
emit processError(tr("Cannot change to working directory %1: %2")
emit processError(tr("Cannot change to working directory '%1': %2")
.arg(workingDirectory(), winErrorMessage(out.mid(10).toInt())));
} else if (out.startsWith("err:exec ")) {
emit processError(tr("Cannot execute %1: %2")
emit processError(tr("Cannot execute '%1': %2")
.arg(m_executable, winErrorMessage(out.mid(9).toInt())));
} else if (out.startsWith("pid ")) {
// Will not need it any more
......
......@@ -35,12 +35,36 @@
#include <QtCore/QFutureInterface>
#include <QtCore/QtConcurrentRun>
#include <QtCore/QRegExp>
#include <QtGui/QApplication>
#include <QtCore/QCoreApplication>
#include <qtconcurrent/runextensions.h>
using namespace Core::Utils;
static inline QString msgCanceled(const QString &searchTerm, int numMatches, int numFilesSearched)
{
return QCoreApplication::translate("Core::Utils::FileSearch",
"%1: canceled. %n occurrences found in %2 files.",
0, QCoreApplication::CodecForTr, numMatches).
arg(searchTerm).arg(numFilesSearched);
}
static inline QString msgFound(const QString &searchTerm, int numMatches, int numFilesSearched)
{
return QCoreApplication::translate("Core::Utils::FileSearch",
"%1: %n occurrences found in %2 files.",
0, QCoreApplication::CodecForTr, numMatches).
arg(searchTerm).arg(numFilesSearched);
}
static inline QString msgFound(const QString &searchTerm, int numMatches, int numFilesSearched, int filesSize)
{
return QCoreApplication::translate("Core::Utils::FileSearch",
"%1: %n occurrences found in %2 of %3 files.",
0, QCoreApplication::CodecForTr, numMatches).
arg(searchTerm).arg(numFilesSearched).arg(filesSize);
}
namespace {
void runFileSearch(QFutureInterface<FileSearchResult> &future,
......@@ -71,9 +95,7 @@ void runFileSearch(QFutureInterface<FileSearchResult> &future,
if (future.isPaused())
future.waitForResume();
if (future.isCanceled()) {
future.setProgressValueAndText(numFilesSearched,
QApplication::translate("FileSearch", "%1: canceled. %2 occurrences found in %3 files.").
arg(searchTerm).arg(numMatches).arg(numFilesSearched));
future.setProgressValueAndText(numFilesSearched, msgCanceled(searchTerm, numMatches, numFilesSearched));
break;
}
QFile file(s);
......@@ -146,14 +168,10 @@ void runFileSearch(QFutureInterface<FileSearchResult> &future,
firstChunk = false;
}
++numFilesSearched;
future.setProgressValueAndText(numFilesSearched,
QApplication::translate("FileSearch", "%1: %2 occurrences found in %3 of %4 files.").
arg(searchTerm).arg(numMatches).arg(numFilesSearched).arg(files.size()));
future.setProgressValueAndText(numFilesSearched, msgFound(searchTerm, numMatches, numFilesSearched, files.size()));
}
if (!future.isCanceled())
future.setProgressValueAndText(numFilesSearched,
QApplication::translate("FileSearch", "%1: %2 occurrences found in %3 files.").
arg(searchTerm).arg(numMatches).arg(numFilesSearched));
future.setProgressValueAndText(numFilesSearched, msgFound(searchTerm, numMatches, numFilesSearched));
}
void runFileSearchRegExp(QFutureInterface<FileSearchResult> &future,
......@@ -165,17 +183,15 @@ void runFileSearchRegExp(QFutureInterface<FileSearchResult> &future,
int numFilesSearched = 0;
int numMatches = 0;
if (flags & QTextDocument::FindWholeWords)
searchTerm = QString("\\b%1\\b").arg(searchTerm);
Qt::CaseSensitivity caseSensitivity = (flags & QTextDocument::FindCaseSensitively) ? Qt::CaseSensitive : Qt::CaseInsensitive;
QRegExp expression(searchTerm, caseSensitivity);
searchTerm = QString::fromLatin1("\\b%1\\b").arg(searchTerm);
const Qt::CaseSensitivity caseSensitivity = (flags & QTextDocument::FindCaseSensitively) ? Qt::CaseSensitive : Qt::CaseInsensitive;
const QRegExp expression(searchTerm, caseSensitivity);
foreach (QString s, files) {
foreach (const QString &s, files) {
if (future.isPaused())
future.waitForResume();
if (future.isCanceled()) {
future.setProgressValueAndText(numFilesSearched,
QApplication::translate("FileSearch", "%1: canceled. %2 occurrences found in %3 files.").
arg(searchTerm).arg(numMatches).arg(numFilesSearched));
future.setProgressValueAndText(numFilesSearched, msgCanceled(searchTerm, numMatches, numFilesSearched));
break;
}
QFile file(s);
......@@ -195,14 +211,10 @@ void runFileSearchRegExp(QFutureInterface<FileSearchResult> &future,
++lineNr;
}
++numFilesSearched;
future.setProgressValueAndText(numFilesSearched,
QApplication::translate("FileSearch", "%1: %2 occurrences found in %3 of %4 files.").
arg(searchTerm).arg(numMatches).arg(numFilesSearched).arg(files.size()));
future.setProgressValueAndText(numFilesSearched, msgFound(searchTerm, numMatches, numFilesSearched, files.size()));
}
if (!future.isCanceled())
future.setProgressValueAndText(numFilesSearched,
QApplication::translate("FileSearch", "%1: %2 occurrences found in %3 files.").
arg(searchTerm).arg(numMatches).arg(numFilesSearched));
future.setProgressValueAndText(numFilesSearched, msgFound(searchTerm, numMatches, numFilesSearched));
}
} // namespace
......
......@@ -68,7 +68,7 @@ QString GeneralSettings::trCategory() const
QWidget *GeneralSettings::createPage(QWidget *parent)
{
m_page = new Ui_GeneralSettings();
m_page = new Ui::GeneralSettings();
QWidget *w = new QWidget(parent);
m_page->setupUi(w);
......
......@@ -33,13 +33,13 @@
#include <coreplugin/dialogs/ioptionspage.h>
#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE
class Ui_GeneralSettings;
QT_END_NAMESPACE
namespace Core {
namespace Internal {
namespace Ui {
class GeneralSettings;
}
class GeneralSettings : public IOptionsPage
{
Q_OBJECT
......@@ -64,7 +64,7 @@ private slots:
#endif
private:
Ui_GeneralSettings *m_page;
Ui::GeneralSettings *m_page;
QWidget *m_dialog;
};
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>GeneralSettings</class>
<widget class="QWidget" name="GeneralSettings">
<class>Core::Internal::GeneralSettings</class>
<widget class="QWidget" name="Core::Internal::GeneralSettings">
<property name="geometry">
<rect>
<x>0</x>
......@@ -62,7 +62,7 @@
<height>0</height>
</size>
</property>
<property name="alphaAllowed" stdset="0">
<property name="alphaAllowed">
<bool>false</bool>
</property>
</widget>
......
......@@ -120,7 +120,7 @@ WelcomeMode::~WelcomeMode()
QString WelcomeMode::name() const
{
return QLatin1String("Welcome");
return tr("Welcome");
}
QIcon WelcomeMode::icon() const
......
......@@ -42,7 +42,8 @@ using namespace QuickOpen::Internal;
DirectoryFilter::DirectoryFilter()
: m_name(tr("Generic Directory Filter")),
m_filters(QStringList() << "*.h" << "*.cpp" << "*.ui" << "*.qrc")
m_filters(QStringList() << QLatin1String("*.h") << QLatin1String("*.cpp")
<< QLatin1String("*.ui") << QLatin1String("*.qrc"))
{
setIncludedByDefault(true);
}
......@@ -112,7 +113,7 @@ bool DirectoryFilter::openConfigDialog(QWidget *parent, bool &needsRefresh)
m_ui.nameEdit->selectAll();
m_ui.directoryList->clear();
m_ui.directoryList->addItems(m_directories);
m_ui.fileTypeEdit->setText(m_filters.join(tr(",")));
m_ui.fileTypeEdit->setText(m_filters.join(QString(QLatin1Char(','))));
m_ui.shortcutEdit->setText(shortcutString());
m_ui.defaultFlag->setChecked(!isIncludedByDefault());
updateOptionButtons();
......@@ -132,7 +133,7 @@ bool DirectoryFilter::openConfigDialog(QWidget *parent, bool &needsRefresh)
if (!directoriesChanged && m_directories.at(i) != oldDirectories.at(i))
directoriesChanged = true;
}
m_filters = m_ui.fileTypeEdit->text().trimmed().split(tr(","));
m_filters = m_ui.fileTypeEdit->text().trimmed().split(QLatin1Char(','));
setShortcutString(m_ui.shortcutEdit->text().trimmed());
setIncludedByDefault(!m_ui.defaultFlag->isChecked());
if (directoriesChanged || oldFilters != m_filters)
......@@ -207,7 +208,8 @@ void DirectoryFilter::refresh(QFutureInterface<void> &future)
}
while (!dirs.isEmpty() && !future.isCanceled()) {
if (future.isProgressUpdateNeeded()) {
future.setProgressValueAndText(progress, tr("%1 filter update: %2 files").arg(m_name).arg(files.size()));
future.setProgressValueAndText(progress,
tr("%1 filter update: %n files", 0, files.size()).arg(m_name));
}
QDir dir = dirs.pop();
int dirProgressMax = progressValues.pop();
......
......@@ -63,7 +63,7 @@
</property>
<property name="toolTip">
<string>Specify a short word/abbreviation that can be used to restrict completions to files from this directory tree.
To do this you type this shortcut and a space in the QuickOpen entry field, and then the word to search for.</string>
To do this, you type this shortcut and a space in the Locator entry field, and then the word to search for.</string>
</property>
</widget>
</item>
......
......@@ -699,8 +699,8 @@ void BookmarkManager::removeBookmarkItem(QTreeView *treeView, const QModelIndex&
QString data = index.data(Qt::UserRole + 10).toString();
if (data == QLatin1String("Folder") && item->rowCount() > 0) {
int value = QMessageBox::question(treeView, tr("Remove"),
tr("You are going to delete a Folder, this will also<br>"
"remove it's content. Are you sure to continue?"),
tr("You are going to delete a Folder which will also<br>"
"remove its content. Are you sure to continue?"),
QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
if (value == QMessageBox::Cancel)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment