summaryrefslogtreecommitdiffstats
path: root/src/linguist/lupdate/qdeclarative.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2013-08-01 14:41:08 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-06 09:30:39 +0200
commit20ce1bdb3dd7b1b8868145bf8aec6a9bb788903b (patch)
tree067ea47e0cc53568eafaf3ad1354855cfeda570b /src/linguist/lupdate/qdeclarative.cpp
parenta4e8dca0c3665a26ff5e7dffada97aeab86dd1a5 (diff)
update all data of existing messages in extend()
when the message identifier (msgid or context/source/disambiguation) appears in multiple places, the remaining meta data may be inconsistent between the occurrences. we need to handle partial data on one hand, and contradicting data on the other. Task-number: QTBUG-29131 Task-number: QTBUG-32725 Change-Id: I1ed08e42e266b0b5f014400c137abbcec9ffb93d Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'src/linguist/lupdate/qdeclarative.cpp')
-rw-r--r--src/linguist/lupdate/qdeclarative.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/linguist/lupdate/qdeclarative.cpp b/src/linguist/lupdate/qdeclarative.cpp
index 41ef6980e..9a5e70c05 100644
--- a/src/linguist/lupdate/qdeclarative.cpp
+++ b/src/linguist/lupdate/qdeclarative.cpp
@@ -76,8 +76,9 @@ static QString MagicComment(QLatin1String("TRANSLATOR"));
class FindTrCalls: protected AST::Visitor
{
public:
- FindTrCalls(Engine *engine)
+ FindTrCalls(Engine *engine, ConversionData &cd)
: engine(engine)
+ , m_cd(cd)
{
}
@@ -140,7 +141,7 @@ protected:
msg.setExtraComment(extracomment.simplified());
msg.setId(msgid);
msg.setExtras(extra);
- m_translator->extend(msg);
+ m_translator->extend(msg, m_cd);
consumeComment();
} else if (name == QLatin1String("qsTranslate") ||
name == QLatin1String("QT_TRANSLATE_NOOP")) {
@@ -184,7 +185,7 @@ protected:
msg.setExtraComment(extracomment.simplified());
msg.setId(msgid);
msg.setExtras(extra);
- m_translator->extend(msg);
+ m_translator->extend(msg, m_cd);
consumeComment();
} else if (name == QLatin1String("qsTrId") ||
name == QLatin1String("QT_TRID_NOOP")) {
@@ -213,7 +214,7 @@ protected:
msg.setExtraComment(extracomment.simplified());
msg.setId(id);
msg.setExtras(extra);
- m_translator->extend(msg);
+ m_translator->extend(msg, m_cd);
consumeComment();
}
}
@@ -248,6 +249,7 @@ private:
Engine *engine;
Translator *m_translator;
+ ConversionData &m_cd;
QString m_fileName;
QString m_component;
@@ -496,7 +498,7 @@ static bool load(Translator &translator, const QString &filename, ConversionData
driver.setLexer(&lexer);
if (qmlMode ? parser.parse() : parser.parseProgram()) {
- FindTrCalls trCalls(&driver);
+ FindTrCalls trCalls(&driver, cd);
//find all tr calls in the code
trCalls(&translator, filename, parser.rootNode());