summaryrefslogtreecommitdiffstats
path: root/tests/auto/linguist/lupdate/testdata/good/parseqml/main.qml
blob: c19bffc721be590f82b4aaff137ebeab4183b575 (plain)
1
2
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import QtQuick 1.0

QtObject {
    function translate() {
        qsTr("One");
        qsTranslate("FooContext", "Two");

        var greeting_strings = [
            QT_TR_NOOP("Hello"),
            QT_TRANSLATE_NOOP("FooContext", "Goodbye")
        ];

        qsTr("One", "not the same one");

        //: My first comment.
        qsTr("See comment");

        //: My second comment.
        qsTranslate("BarContext", "See other comment");

        //: My third comment
        //: spans two lines.
        qsTr("The comment explains it all");

        //: My fourth comment
        //: spans a whopping
        //: three lines.
        qsTranslate("BazContext", "It should be clear by now");

        /*: C-style comment. */
        qsTr("I love C++");

        /*: Another C-style comment. */
        qsTranslate("FooContext", "I really love C++");

        /*: C-style comment, followed by */
        /*: another one. */
        qsTr("Qt is the best");

        /*: Another C-style comment, followed by */
        /*: yet another one. */
        qsTranslate("BarContext", "Qt is the very best");

        // This comment doesn't have any effect.
        qsTr("The comment had no effect");

        // This comment doesn't have any effect either.
        qsTranslate("BazContext", "The comment had no effect, really");

        /* This C-style comment doesn't have any effect. */
        qsTr("No comment to your comment");

        /* This C-style comment doesn't have any effect either. */
        qsTranslate("FooContext", "I refuse to comment on that");

        //= id_foo
        qsTr("This string has an identifier");

        //= id_bar
        qsTranslate("BarContext", "This string also has an identifier");

        //~ loc-blank False
        qsTr("This string has meta-data");

        //~ loc-layout_id foo_dialog
        qsTranslate("BazContext", "This string also has meta-data");

        // This comment is to be ignored.
        //: This is a comment for the translator.
        //= id_baz
        //~ foo 123
        //~ magic-stuff This means something special.
        qsTr("This string has a lot of information");

        // This comment is also to be ignored.
        //: This is another comment for the translator.
        //= id_babar
        //~ foo-bar Important stuff
        //~ needle-in-haystack Found
        //~ overflow True
        qsTranslate("FooContext", "This string has even more information");

        qsTr("This string has disambiguation", "Disambiguation");

        qsTranslate("BarContext", "This string also has disambiguation", "Another disambiguation");

        qsTr("This string contains plurals", "", 10);

        qsTrId("qtn_foo_bar");

        var more_greeting_strings = [ QT_TRID_NOOP("qtn_needle"), QT_TRID_NOOP("qtn_haystack") ];

        //: qsTrId() with comment, meta-data and plurals.
        //~ well-tested True
        qsTrId("qtn_bar_baz", 10);

        //% "Source text"
        qsTrId("qtn_baz_biz");

        //~ quoted " string with spaces "
        qsTr("translation with extras-quoted field");

	// template literals are supported
        qsTr(`template literal`);
        qsTranslate("TemplateLiteral", 'template literal 2');
    }
}