From 0e7f89530625d028b2961c75b481beed4e623c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 1 Feb 2011 15:17:53 +0100 Subject: Don't ignore source-text when generating qsTrId translations for QML Reviewed-by: ossi (cherry picked from commit bb84c5ef4f620af659395b66e6ed792a380b9a1f) --- tests/auto/linguist/lupdate/testdata/good/parseqml/main.qml | 3 +++ tests/auto/linguist/lupdate/testdata/good/parseqml/project.ts.result | 5 +++++ tools/linguist/lupdate/qdeclarative.cpp | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/auto/linguist/lupdate/testdata/good/parseqml/main.qml b/tests/auto/linguist/lupdate/testdata/good/parseqml/main.qml index 768a4e2..c966fa1 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parseqml/main.qml +++ b/tests/auto/linguist/lupdate/testdata/good/parseqml/main.qml @@ -93,5 +93,8 @@ QtObject { //: qsTrId() with comment, meta-data and plurals. //~ well-tested True qsTrId("qtn_bar_baz", 10); + + //% "Source text" + qsTrId("qtn_baz_biz"); } } diff --git a/tests/auto/linguist/lupdate/testdata/good/parseqml/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parseqml/project.ts.result index 7dac8cb..4843902 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parseqml/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/parseqml/project.ts.result @@ -27,6 +27,11 @@ True + + + Source text + + BarContext diff --git a/tools/linguist/lupdate/qdeclarative.cpp b/tools/linguist/lupdate/qdeclarative.cpp index b85b1a7..1c1e9ad 100644 --- a/tools/linguist/lupdate/qdeclarative.cpp +++ b/tools/linguist/lupdate/qdeclarative.cpp @@ -225,7 +225,7 @@ protected: const QString id = literal->value->asString(); bool plural = node->arguments->next; - TranslatorMessage msg(QString(), QString(), + TranslatorMessage msg(QString(), sourcetext, QString(), QString(), m_fileName, node->firstSourceLocation().startLine, QStringList(), TranslatorMessage::Unfinished, plural); -- cgit v0.12