Debian Codegraph @

tests/auto/linguist/lupdate/testdata/good/parseqml2/main.qml

raw
1 // Copyright (C) 2016 The Qt Company Ltd.
2 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 import QtQuick 1.0; QtObject {
30 function translate() {
31 qsTranslate();
32 qsTranslate(10);
33 qsTranslate(10, 20);
34 qsTranslate("10", 20);
35 qsTranslate(10, "20");
36
37 QT_TRANSLATE_NOOP();
38 QT_TRANSLATE_NOOP(10);
39 QT_TRANSLATE_NOOP(10, 20);
40 QT_TRANSLATE_NOOP("10", 20);
41 QT_TRANSLATE_NOOP(10, "20");
42
43 qsTr();
44 qsTr(10);
45
46 QT_TR_NOOP();
47 QT_TR_NOOP(10);
48
49 qsTrId();
50 qsTrId(10);
51
52 QT_TRID_NOOP();
53 QT_TRID_NOOP(10);
54
55 //% This is wrong
56 //% "This is not wrong" This is wrong
57 //% "I forgot to close the meta string
58 //% "Being evil \
59
60 //% "Should cause a warning"
61 qsTranslate("FooContext", "Hello");
62 //% "Should cause a warning"
63 QT_TRANSLATE_NOOP("FooContext", "World");
64 //% "Should cause a warning"
65 qsTr("Hello");
66 //% "Should cause a warning"
67 QT_TR_NOOP("World");
68
69 //: This comment will be discarded.
70 Math.sin(1);
71 //= id_foobar
72 Math.cos(2);
73 //~ underflow False
74 Math.tan(3);
75
76 /*
77 Not tested for now, because these should perhaps not cause
78 translation entries to be generated at all; see QTBUG-11843.
79
80 //= qtn_foo
81 qsTrId("qtn_foo");
82 //= qtn_bar
83 QT_TRID_NOOP("qtn_bar");
84 */
85
86 }
87
88 }