forked from qt-creator/qt-creator
QmlBundle: Do not translate warnings
The warnings are just shown on console / through qWarning(), so there's no need to translate them. Change-Id: I27bc9a043d9dd76d41fcde6c253b04b69fef40ad Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
@@ -223,7 +223,8 @@ QStringList QmlBundle::maybeReadTrie(Trie &trie, Utils::JsonObjectValue *config,
|
|||||||
QStringList res;
|
QStringList res;
|
||||||
if (!config->hasMember(propertyName)) {
|
if (!config->hasMember(propertyName)) {
|
||||||
if (required)
|
if (required)
|
||||||
res << tr("Missing required property \"%1\" from %2").arg(propertyName, path);
|
res << QString::fromLatin1("Missing required property \"%1\" from %2").arg(propertyName,
|
||||||
|
path);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
Utils::JsonValue *imp0 = config->member(propertyName);
|
Utils::JsonValue *imp0 = config->member(propertyName);
|
||||||
@@ -234,14 +235,15 @@ QStringList QmlBundle::maybeReadTrie(Trie &trie, Utils::JsonObjectValue *config,
|
|||||||
if (impStr != 0) {
|
if (impStr != 0) {
|
||||||
trie.insert(impStr->value());
|
trie.insert(impStr->value());
|
||||||
} else {
|
} else {
|
||||||
res.append(tr("Expected all elements of array in property \"%1\" to be strings in QmlBundle at %2.")
|
res.append(QString::fromLatin1("Expected all elements of array in property \"%1\" "
|
||||||
.arg(propertyName).arg(path));
|
"to be strings in QmlBundle at %2.")
|
||||||
|
.arg(propertyName, path));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
res.append(tr("Expected string array in property \"%1\" in QmlBundle at %2.")
|
res.append(QString::fromLatin1("Expected string array in property \"%1\" in QmlBundle at %2.")
|
||||||
.arg(propertyName).arg(path));
|
.arg(propertyName, path));
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -252,13 +254,13 @@ bool QmlBundle::readFrom(QString path, QStringList *errors)
|
|||||||
QFile f(path);
|
QFile f(path);
|
||||||
if (!f.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
if (!f.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
if (errors)
|
if (errors)
|
||||||
(*errors) << tr("Could not open QmlBundle at %1 .").arg(path);
|
(*errors) << QString::fromLatin1("Could not open file at %1 .").arg(path);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
JsonObjectValue *config = JsonValue::create(QString::fromUtf8(f.readAll()))->toObject();
|
JsonObjectValue *config = JsonValue::create(QString::fromUtf8(f.readAll()))->toObject();
|
||||||
if (config == 0) {
|
if (config == 0) {
|
||||||
if (errors)
|
if (errors)
|
||||||
(*errors) << tr("Could not parse json object in QmlBundle at %1 .").arg(path);
|
(*errors) << QString::fromLatin1("Could not parse json object in file at %1 .").arg(path);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
QStringList errs;
|
QStringList errs;
|
||||||
@@ -268,10 +270,11 @@ bool QmlBundle::readFrom(QString path, QStringList *errors)
|
|||||||
if (n != 0)
|
if (n != 0)
|
||||||
m_name = n->value();
|
m_name = n->value();
|
||||||
else
|
else
|
||||||
errs.append(tr("Property \"name\" in QmlBundle at %1 is expected to be a string.")
|
errs.append(QString::fromLatin1("Property \"name\" in QmlBundle at %1 is expected "
|
||||||
.arg(path));
|
"to be a string.").arg(path));
|
||||||
} else {
|
} else {
|
||||||
errs.append(tr("Missing required property \"name\" in QmlBundle at %1 .").arg(path));
|
errs.append(QString::fromLatin1("Missing required property \"name\" in QmlBundle "
|
||||||
|
"at %1 .").arg(path));
|
||||||
}
|
}
|
||||||
errs << maybeReadTrie(m_searchPaths, config, path, QLatin1String("searchPaths"));
|
errs << maybeReadTrie(m_searchPaths, config, path, QLatin1String("searchPaths"));
|
||||||
errs << maybeReadTrie(m_installPaths, config, path, QLatin1String("installPaths"));
|
errs << maybeReadTrie(m_installPaths, config, path, QLatin1String("installPaths"));
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ namespace QmlJS {
|
|||||||
*/
|
*/
|
||||||
class QMLJS_EXPORT QmlBundle
|
class QMLJS_EXPORT QmlBundle
|
||||||
{
|
{
|
||||||
Q_DECLARE_TR_FUNCTIONS(QmlJS::QmlBundle)
|
|
||||||
typedef PersistentTrie::Trie Trie;
|
typedef PersistentTrie::Trie Trie;
|
||||||
public:
|
public:
|
||||||
QmlBundle(const QmlBundle &o);
|
QmlBundle(const QmlBundle &o);
|
||||||
|
|||||||
Reference in New Issue
Block a user