summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2011-12-13 16:17:43 +0100
committerFriedemann Kleint <Friedemann.Kleint@nokia.com>2011-12-13 16:20:26 +0100
commit948c7af9f202cac2fc02679172acb069ca61bfcd (patch)
tree16b46e6bcc51ee8b3ed7f017d967f8d33671aae5 /src
parent0d08db21891e5b647c108a2ad8e955e13f84ceaf (diff)
downloadqt-creator-948c7af9f202cac2fc02679172acb069ca61bfcd.tar.gz
tr()-Fixes.
- Capitalization - Fix lupdate warnings about tr() Usage in ZeroConf - Fix some messages. Change-Id: I95e4095ce54040e30d9a7968407bfc99b76643ff Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/libs/qmljs/qmljsstaticanalysismessage.cpp17
-rw-r--r--src/libs/zeroconf/avahiLib.cpp15
-rw-r--r--src/libs/zeroconf/embeddedLib.cpp2
-rw-r--r--src/libs/zeroconf/servicebrowser_p.h2
-rw-r--r--src/plugins/debugger/debuggerdialogs.cpp2
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp2
-rw-r--r--src/plugins/locator/executefilter.cpp2
-rw-r--r--src/plugins/qmljseditor/qmljsquickfixes.cpp1
-rw-r--r--src/plugins/qmljseditor/qmljswrapinloader.cpp16
9 files changed, 33 insertions, 26 deletions
diff --git a/src/libs/qmljs/qmljsstaticanalysismessage.cpp b/src/libs/qmljs/qmljsstaticanalysismessage.cpp
index bd66fc76f6..c5b23cae63 100644
--- a/src/libs/qmljs/qmljsstaticanalysismessage.cpp
+++ b/src/libs/qmljs/qmljsstaticanalysismessage.cpp
@@ -70,6 +70,11 @@ public:
QHash<Type, PrototypeMessageData> messages;
};
+static inline QString msgInvalidConstructor(const char *what)
+{
+ return StaticAnalysisMessages::tr("do not use '%1' as a constructor").arg(QLatin1String(what));
+}
+
StaticAnalysisMessages::StaticAnalysisMessages()
{
// When changing a message or severity, update the documentation, currently
@@ -133,15 +138,15 @@ StaticAnalysisMessages::StaticAnalysisMessages()
newMsg(WarnFunctionUsedBeforeDeclaration, Warning,
tr("function '%1' is used before its declaration"), 1);
newMsg(WarnBooleanConstructor, Warning,
- tr("do not use 'Boolean' as a constructor"));
+ msgInvalidConstructor("Boolean"));
newMsg(WarnStringConstructor, Warning,
- tr("do not use 'String' as a constructor"));
+ msgInvalidConstructor("String"));
newMsg(WarnObjectConstructor, Warning,
- tr("do not use 'Object' as a constructor"));
+ msgInvalidConstructor("Object"));
newMsg(WarnArrayConstructor, Warning,
- tr("do not use 'Array' as a constructor"));
+ msgInvalidConstructor("Array"));
newMsg(WarnFunctionConstructor, Warning,
- tr("do not use 'Function' as a constructor"));
+ msgInvalidConstructor("Function"));
newMsg(HintAnonymousFunctionSpacing, Hint,
tr("the 'function' keyword and the opening parenthesis should be separated by a single space"));
newMsg(WarnBlock, Warning,
@@ -181,7 +186,7 @@ StaticAnalysisMessages::StaticAnalysisMessages()
newMsg(WarnNewWithLowercaseFunction, Warning,
tr("'new' should only be used with functions that start with an uppercase letter"));
newMsg(WarnNumberConstructor, Warning,
- tr("do not use 'Number' as a constructor"));
+ msgInvalidConstructor("Function"));
newMsg(HintBinaryOperatorSpacing, Hint,
tr("use spaces around binary operators"));
newMsg(WarnUnintentinalEmptyBlock, Warning,
diff --git a/src/libs/zeroconf/avahiLib.cpp b/src/libs/zeroconf/avahiLib.cpp
index 5177db352e..bdb5469eed 100644
--- a/src/libs/zeroconf/avahiLib.cpp
+++ b/src/libs/zeroconf/avahiLib.cpp
@@ -129,7 +129,8 @@ public:
#ifndef ZCONF_AVAHI_STATIC_LINKING
// dynamic linking
if (!nativeLib.load()) {
- setError(true, tr("AvahiZConfLib could not load native library"));
+ setError(true,
+ ZConfLib::tr("AvahiZConfLib could not load the native library '%1': %2").arg(libName, nativeLib.errorString()));
}
m_simplePollGet = reinterpret_cast<AvahiSimplePollGet>(nativeLib.resolve("avahi_simple_poll_get"));
m_simplePollNew = reinterpret_cast<AvahiSimplePollNewPtr>(nativeLib.resolve("avahi_simple_poll_new"));
@@ -316,7 +317,7 @@ public:
if (m_simplePollFree)
m_simplePollFree(connection->simple_poll);
delete connection;
- setError(true, tr("%1 could not create a client (probably the daemon is not running)"));
+ setError(true, ZConfLib::tr("%1 could not create a client (probably the daemon is not running)").arg(name()));
return kDNSServiceErr_Unknown;
}
*sdRef = reinterpret_cast<ConnectionRef>(connection);
@@ -440,16 +441,16 @@ extern "C" void cAvahiClientReply (AvahiClient * /*s*/, AvahiClientState state,
break;
case (AVAHI_CLIENT_S_COLLISION):
/* Server state: COLLISION */
- lib->setError(true, lib->tr("cAvahiClient, server collision"));
+ lib->setError(true, ZConfLib::tr("cAvahiClient, server collision"));
break;
case (AVAHI_CLIENT_FAILURE):
- lib->setError(true, lib->tr("cAvahiClient, some kind of error happened on the client side"));
+ lib->setError(true, ZConfLib::tr("cAvahiClient, some kind of error happened on the client side"));
break;
case (AVAHI_CLIENT_CONNECTING):
- lib->setError(false, lib->tr("cAvahiClient, still connecting, no server available"));
+ lib->setError(false, ZConfLib::tr("cAvahiClient, still connecting, no server available"));
break;
default:
- lib->setError(true, lib->tr("Error: unexpected state %1 in cAvahiClientReply, ignoring it")
+ lib->setError(true, ZConfLib::tr("Error: unexpected state %1 in cAvahiClientReply, ignoring it")
.arg(state));
}
}
@@ -484,7 +485,7 @@ extern "C" void cAvahiBrowseReply(
browser->updateFlowStatusForFlags(0);
break;
default:
- browser->mainConnection->lib->setError(true, browser->mainConnection->lib->tr(
+ browser->mainConnection->lib->setError(true, ZConfLib::tr(
"Error: unexpected state %1 in cAvahiBrowseReply, ignoring it")
.arg(event));
}
diff --git a/src/libs/zeroconf/embeddedLib.cpp b/src/libs/zeroconf/embeddedLib.cpp
index c7e13ecdc2..f2a2145b52 100644
--- a/src/libs/zeroconf/embeddedLib.cpp
+++ b/src/libs/zeroconf/embeddedLib.cpp
@@ -85,7 +85,7 @@ public:
qDebug() << name() << " started " << daemonPath;
return true;
} else {
- this->setError(true, tr("%1 failed starting embedded daemon at %2")
+ this->setError(true, ZConfLib::tr("%1 failed starting embedded daemon at %2")
.arg(name()).arg(daemonPath));
}
}
diff --git a/src/libs/zeroconf/servicebrowser_p.h b/src/libs/zeroconf/servicebrowser_p.h
index bcf2389517..a8712f7ba6 100644
--- a/src/libs/zeroconf/servicebrowser_p.h
+++ b/src/libs/zeroconf/servicebrowser_p.h
@@ -56,7 +56,7 @@ class ServiceBrowserPrivate;
// represents a zero conf library exposing the dns-sd interface
class ZConfLib {
- Q_DECLARE_TR_FUNCTIONS(ZeroConf)
+ Q_DECLARE_TR_FUNCTIONS(ZeroConf::Internal::ZConfLib)
public:
typedef QSharedPointer<ZConfLib> Ptr;
typedef void *ConnectionRef;
diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp
index ed13bf9674..9741dca8b7 100644
--- a/src/plugins/debugger/debuggerdialogs.cpp
+++ b/src/plugins/debugger/debuggerdialogs.cpp
@@ -1008,7 +1008,7 @@ public:
m_layout->addWidget(new QLabel(type), row, column++);
for (int i = -1; i != typeFormats.size(); ++i) {
QRadioButton *choice = new QRadioButton(this);
- choice->setText(i == -1 ? tr("Reset") : typeFormats.at(i));
+ choice->setText(i == -1 ? TypeFormatsDialog::tr("Reset") : typeFormats.at(i));
m_layout->addWidget(choice, row, column++);
if (i == current)
choice->setChecked(true);
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 0a142228cb..7afed3929e 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -1727,7 +1727,7 @@ void DebuggerPluginPrivate::gdbServerStarted(const QString &channel,
QList<Abi> abis = Abi::abisOfBinary(localExecutable);
if (abis.isEmpty()) {
QMessageBox::warning(mainWindow(), tr("Warning"),
- tr("Cannot find abi for remote process \"%1\".")
+ tr("Cannot find ABI for remote process \"%1\".")
.arg(remoteCommandLine));
return;
}
diff --git a/src/plugins/locator/executefilter.cpp b/src/plugins/locator/executefilter.cpp
index b643fc1081..c1bad10c88 100644
--- a/src/plugins/locator/executefilter.cpp
+++ b/src/plugins/locator/executefilter.cpp
@@ -109,7 +109,7 @@ void ExecuteFilter::accept(FilterEntry selection) const
if (m_process->state() != QProcess::NotRunning) {
const QString info(tr("Previous command is still running ('%1').\nDo you want to kill it?")
.arg(p->headCommand()));
- int r = QMessageBox::question(0, tr("Kill previous process?"), info,
+ int r = QMessageBox::question(0, tr("Kill Previous Process?"), info,
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
QMessageBox::Yes);
if (r == QMessageBox::Yes)
diff --git a/src/plugins/qmljseditor/qmljsquickfixes.cpp b/src/plugins/qmljseditor/qmljsquickfixes.cpp
index 8c5b25f99c..61d3175769 100644
--- a/src/plugins/qmljseditor/qmljsquickfixes.cpp
+++ b/src/plugins/qmljseditor/qmljsquickfixes.cpp
@@ -138,6 +138,7 @@ private:
*/
class AddAnalysisMessageSuppressionComment: public QmlJSQuickFixFactory
{
+ Q_DECLARE_TR_FUNCTIONS(QmlJSEditor::AddAnalysisMessageSuppressionComment)
public:
virtual QList<QmlJSQuickFixOperation::Ptr> match(
const QSharedPointer<const QmlJSQuickFixAssistInterface> &interface)
diff --git a/src/plugins/qmljseditor/qmljswrapinloader.cpp b/src/plugins/qmljseditor/qmljswrapinloader.cpp
index 21c47f3647..dcb73f200a 100644
--- a/src/plugins/qmljseditor/qmljswrapinloader.cpp
+++ b/src/plugins/qmljseditor/qmljswrapinloader.cpp
@@ -43,6 +43,7 @@
#include <QtCore/QDir>
#include <QtCore/QFileInfo>
+#include <QtCore/QCoreApplication>
using namespace QmlJS;
using namespace QmlJS::AST;
@@ -79,6 +80,8 @@ protected:
class Operation: public QmlJSQuickFixOperation
{
+ Q_DECLARE_TR_FUNCTIONS(QmlJSEditor::Internal::Operation)
+
UiObjectDefinition *m_objDef;
public:
@@ -89,7 +92,7 @@ public:
{
Q_ASSERT(m_objDef != 0);
- setDescription(WrapInLoader::tr("Wrap Component in Loader"));
+ setDescription(tr("Wrap Component in Loader"));
}
QString findFreeName(const QString &base)
@@ -129,12 +132,10 @@ public:
FindIds::Result innerIds = FindIds()(m_objDef);
innerIds.remove(id);
- QString comment = WrapInLoader::tr(
- "// TODO: Move position bindings from the component to the Loader.\n"
- "// Check all uses of 'parent' inside the root element of the component.\n");
+ QString comment = tr("// TODO: Move position bindings from the component to the Loader.\n"
+ "// Check all uses of 'parent' inside the root element of the component.\n");
if (idBinding) {
- comment += WrapInLoader::tr(
- "// Rename all outer uses of the id '%1' to '%2.item'.\n").arg(
+ comment += tr("// Rename all outer uses of the id '%1' to '%2.item'.\n").arg(
id, loaderId);
}
@@ -144,8 +145,7 @@ public:
while (it.hasNext()) {
it.next();
const QString innerId = it.key();
- comment += WrapInLoader::tr(
- "// Rename all outer uses of the id '%1' to '%2.item.%1'.\n").arg(
+ comment += tr("// Rename all outer uses of the id '%1' to '%2.item.%1'.\n").arg(
innerId, loaderId);
changes.replace(it.value().begin(), it.value().end(), QString("inner_%1").arg(innerId));
innerIdForwarders += QString("\nproperty alias %1: inner_%1").arg(innerId);