Debian Codegraph @

tests/auto/linguist/lupdate/testdata/good/parseqml/main_test_pragma.qml

raw
1 import QtQuick 1.0
2
3 pragma Translator: PragmaContext
4 QtObject {
5 function translate() {
6 qsTr("One");
7 qsTranslate("FooContext", "Two");
8
9 var greeting_strings = [
10 QT_TR_NOOP("Hello"),
11 QT_TRANSLATE_NOOP("FooContext", "Goodbye")
12 ];
13
14 qsTr("One", "not the same one");
15
16 //: My first comment.
17 qsTr("See comment");
18
19 //: My second comment.
20 qsTranslate("BarContext", "See other comment");
21
22 //: My third comment
23 //: spans two lines.
24 qsTr("The comment explains it all");
25
26 //: My fourth comment
27 //: spans a whopping
28 //: three lines.
29 qsTranslate("BazContext", "It should be clear by now");
30
31 /*: C-style comment. */
32 qsTr("I love C++");
33
34 /*: Another C-style comment. */
35 qsTranslate("FooContext", "I really love C++");
36
37 /*: C-style comment, followed by */
38 /*: another one. */
39 qsTr("Qt is the best");
40
41 /*: Another C-style comment, followed by */
42 /*: yet another one. */
43 qsTranslate("BarContext", "Qt is the very best");
44
45 // This comment doesn't have any effect.
46 qsTr("The comment had no effect");
47
48 // This comment doesn't have any effect either.
49 qsTranslate("BazContext", "The comment had no effect, really");
50
51 /* This C-style comment doesn't have any effect. */
52 qsTr("No comment to your comment");
53
54 /* This C-style comment doesn't have any effect either. */
55 qsTranslate("FooContext", "I refuse to comment on that");
56
57 //= id_foo
58 qsTr("This string has an identifier");
59
60 //= id_bar
61 qsTranslate("BarContext", "This string also has an identifier");
62
63 //~ loc-blank False
64 qsTr("This string has meta-data");
65
66 //~ loc-layout_id foo_dialog
67 qsTranslate("BazContext", "This string also has meta-data");
68
69 // This comment is to be ignored.
70 //: This is a comment for the translator.
71 //= id_baz
72 //~ foo 123
73 //~ magic-stuff This means something special.
74 qsTr("This string has a lot of information");
75
76 // This comment is also to be ignored.
77 //: This is another comment for the translator.
78 //= id_babar
79 //~ foo-bar Important stuff
80 //~ needle-in-haystack Found
81 //~ overflow True
82 qsTranslate("FooContext", "This string has even more information");
83
84 qsTr("This string has disambiguation", "Disambiguation");
85
86 qsTranslate("BarContext", "This string also has disambiguation", "Another disambiguation");
87
88 qsTr("This string contains plurals", "", 10);
89
90 qsTrId("qtn_foo_bar");
91
92 var more_greeting_strings = [ QT_TRID_NOOP("qtn_needle"), QT_TRID_NOOP("qtn_haystack") ];
93
94 //: qsTrId() with comment, meta-data and plurals.
95 //~ well-tested True
96 qsTrId("qtn_bar_baz", 10);
97
98 //% "Source text"
99 qsTrId("qtn_baz_biz");
100
101 //~ quoted " string with spaces "
102 qsTr("translation with extras-quoted field");
103 }
104 }