summaryrefslogtreecommitdiffstats
path: root/tests/auto/linguist
diff options
context:
space:
mode:
authorTakumi ASAKI <asaki@sra.co.jp>2015-12-15 13:46:09 +0900
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2016-10-25 09:01:07 +0000
commitf2ebd51d96ad49eb826a4e37e67d506fffcbd40c (patch)
treee95097a54d14d577251f2f6a3247db81a9efc716 /tests/auto/linguist
parent8e7e60dbdea04c943bc6d50290db12d3fefd39f2 (diff)
lupdate: Add qrc resource file support
lupdate parses qrc files specified by the RESOURCES qmake variable or by command line options, and adds files in them as source files. [ChangeLog][lupdate] Added qrc resource file support Task-number: QTBUG-53206 Change-Id: Id7f952487ab11e062db9c5a419fb2ee3c4716740 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'tests/auto/linguist')
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parseqrc/main.cpp42
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parseqrc/main.js1
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parseqrc/main.qml40
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parseqrc/project.pro7
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parseqrc/project.qrc5
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parseqrc/project.ts.result25
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/resources_cmdline/lupdatecmd1
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/resources_cmdline/main.js1
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/resources_cmdline/main.qml40
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/resources_cmdline/project.qrc6
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/resources_cmdline/project.ts.result17
11 files changed, 185 insertions, 0 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/parseqrc/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parseqrc/main.cpp
new file mode 100644
index 000000000..7108f6784
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/parseqrc/main.cpp
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// IMPORTANT!!!! If you want to add testdata to this file,
+// always add it to the end in order to not change the linenumbers of translations!!!
+
+
+void func1() {
+ QApplication::tr("Hello world");
+}
+
+
diff --git a/tests/auto/linguist/lupdate/testdata/good/parseqrc/main.js b/tests/auto/linguist/lupdate/testdata/good/parseqrc/main.js
new file mode 100644
index 000000000..b2e1dd9e0
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/parseqrc/main.js
@@ -0,0 +1 @@
+qsTr("From JavaScript file");
diff --git a/tests/auto/linguist/lupdate/testdata/good/parseqrc/main.qml b/tests/auto/linguist/lupdate/testdata/good/parseqrc/main.qml
new file mode 100644
index 000000000..ea2258343
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/parseqrc/main.qml
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+QtObject {
+ function translate() {
+ qsTr("From QML file in root");
+ }
+}
diff --git a/tests/auto/linguist/lupdate/testdata/good/parseqrc/project.pro b/tests/auto/linguist/lupdate/testdata/good/parseqrc/project.pro
new file mode 100644
index 000000000..5000c7396
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/parseqrc/project.pro
@@ -0,0 +1,7 @@
+
+SOURCES += main.cpp
+
+RESOURCES += project.qrc
+RESOURCES += main.qml
+
+TRANSLATIONS = project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/parseqrc/project.qrc b/tests/auto/linguist/lupdate/testdata/good/parseqrc/project.qrc
new file mode 100644
index 000000000..87bacf228
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/parseqrc/project.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+ <file>main.js</file>
+</qresource>
+</RCC>
diff --git a/tests/auto/linguist/lupdate/testdata/good/parseqrc/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parseqrc/project.ts.result
new file mode 100644
index 000000000..6dcd8c2a5
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/parseqrc/project.ts.result
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1">
+<context>
+ <name>QApplication</name>
+ <message>
+ <location filename="main.cpp" line="39"/>
+ <source>Hello world</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>main</name>
+ <message>
+ <location filename="main.js" line="1"/>
+ <source>From JavaScript file</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="main.qml" line="38"/>
+ <source>From QML file in root</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/lupdatecmd
new file mode 100644
index 000000000..f3709944b
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/lupdatecmd
@@ -0,0 +1 @@
+lupdate project.qrc -ts project.ts
diff --git a/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/main.js b/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/main.js
new file mode 100644
index 000000000..b2e1dd9e0
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/main.js
@@ -0,0 +1 @@
+qsTr("From JavaScript file");
diff --git a/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/main.qml b/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/main.qml
new file mode 100644
index 000000000..ea2258343
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/main.qml
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+QtObject {
+ function translate() {
+ qsTr("From QML file in root");
+ }
+}
diff --git a/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/project.qrc b/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/project.qrc
new file mode 100644
index 000000000..c5bf15067
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/project.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+ <file>main.qml</file>
+ <file>main.js</file>
+</qresource>
+</RCC>
diff --git a/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/project.ts.result
new file mode 100644
index 000000000..82719c026
--- /dev/null
+++ b/tests/auto/linguist/lupdate/testdata/good/resources_cmdline/project.ts.result
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1">
+<context>
+ <name>main</name>
+ <message>
+ <location filename="main.qml" line="38"/>
+ <source>From QML file in root</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="main.js" line="1"/>
+ <source>From JavaScript file</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>