1QTranslatorMessage(3qt)                                QTranslatorMessage(3qt)
2
3
4

NAME

6       QTranslatorMessage - Translator message and its properties
7

SYNOPSIS

9       #include <qtranslator.h>
10
11   Public Members
12       QTranslatorMessage ()
13       QTranslatorMessage ( const char * context, const char * sourceText,
14           const char * comment, const QString & translation = QString::null )
15       QTranslatorMessage ( QDataStream & stream )
16       QTranslatorMessage ( const QTranslatorMessage & m )
17       QTranslatorMessage & operator= ( const QTranslatorMessage & m )
18       uint hash () const
19       const char * context () const
20       const char * sourceText () const
21       const char * comment () const
22       void setTranslation ( const QString & translation )
23       QString translation () const
24       enum Prefix { NoPrefix, Hash, HashContext, HashContextSourceText,
25           HashContextSourceTextComment }
26       void write ( QDataStream & stream, bool strip = FALSE, Prefix prefix =
27           HashContextSourceTextComment ) const
28       Prefix commonPrefix ( const QTranslatorMessage & m ) const
29       bool operator== ( const QTranslatorMessage & m ) const
30       bool operator!= ( const QTranslatorMessage & m ) const
31       bool operator< ( const QTranslatorMessage & m ) const
32       bool operator<= ( const QTranslatorMessage & m ) const
33       bool operator> ( const QTranslatorMessage & m ) const
34       bool operator>= ( const QTranslatorMessage & m ) const
35

DESCRIPTION

37       The QTranslatorMessage class contains a translator message and its
38       properties.
39
40       This class is of no interest to most applications. It is useful for
41       translation tools such as Qt Linguist. It is provided simply to make
42       the API complete and regular.
43
44       For a QTranslator object, a lookup key is a triple (context, source
45       text, comment) that uniquely identifies a message. An extended key is a
46       quadruple (hash, context, source text, comment), where hash is computed
47       from the source text and the comment. Unless you plan to read and write
48       messages yourself, you need not worry about the hash value.
49
50       QTranslatorMessage stores this triple or quadruple and the relevant
51       translation if there is any.
52
53       See also QTranslator, Environment Classes, and Internationalization
54       with Qt.
55
56   Member Type Documentation

QTranslatorMessage::Prefix

58       Let (h, c, s, m) be the extended key. The possible prefixes are
59
60       QTranslatorMessage::NoPrefix - no prefix
61
62       QTranslatorMessage::Hash - only (h)
63
64       QTranslatorMessage::HashContext - only (h, c)
65
66       QTranslatorMessage::HashContextSourceText - only (h, c, s)
67
68       QTranslatorMessage::HashContextSourceTextComment - the whole extended
69       key, (h, c, s, m)
70
71       See also write() and commonPrefix().
72

MEMBER FUNCTION DOCUMENTATION

QTranslatorMessage::QTranslatorMessage ()

75       Constructs a translator message with the extended key (0, 0, 0, 0) and
76       QString::null as translation.
77

QTranslatorMessage::QTranslatorMessage ( const char * context, const char *

79       sourceText, const char * comment, const QString & translation =
80       QString::null )
81       Constructs an translator message with the extended key (h, context,
82       sourceText, comment), where h is computed from sourceText and comment,
83       and possibly with a translation.
84

QTranslatorMessage::QTranslatorMessage ( QDataStream & stream )

86       Constructs a translator message read from the stream. The resulting
87       message may have any combination of content.
88
89       See also QTranslator::save().
90

QTranslatorMessage::QTranslatorMessage ( const QTranslatorMessage & m )

92       Constructs a copy of translator message m.
93

const char * QTranslatorMessage::comment () const

95       Returns the comment for this message (e.g. "File|Save").
96
97       Warning: This may return 0 if the QTranslator object is stripped
98       (compressed).
99

Prefix QTranslatorMessage::commonPrefix ( const QTranslatorMessage & m ) const

101
102       Returns the widest lookup prefix that is common to this translator
103       message and to message m.
104
105       For example, if the extended key is for this message is (71,"
106       PrintDialog", "Yes", "Print?") and that for m is (71," PrintDialog",
107       "No", "Print?"), this function returns HashContext.
108
109       See also write().
110

const char * QTranslatorMessage::context () const

112       Returns the context for this message (e.g. "MyDialog").
113
114       Warning: This may return 0 if the QTranslator object is stripped
115       (compressed).
116

uint QTranslatorMessage::hash () const

118       Returns the hash value used internally to represent the lookup key.
119       This value is zero only if this translator message was constructed from
120       a stream containing invalid data.
121
122       The hashing function is unspecified, but it will remain unchanged in
123       future versions of Qt.
124

bool QTranslatorMessage::operator!= ( const QTranslatorMessage & m ) const

126       Returns TRUE if the extended key of this object is different from that
127       of m; otherwise returns FALSE.
128

bool QTranslatorMessage::operator< ( const QTranslatorMessage & m ) const

130       Returns TRUE if the extended key of this object is lexicographically
131       before than that of m; otherwise returns FALSE.
132

bool QTranslatorMessage::operator<= ( const QTranslatorMessage & m ) const

134       Returns TRUE if the extended key of this object is lexicographically
135       before that of m or if they are equal; otherwise returns FALSE.
136

QTranslatorMessage & QTranslatorMessage::operator= ( const QTranslatorMessage

138       & m )
139       Assigns message m to this translator message and returns a reference to
140       this translator message.
141

bool QTranslatorMessage::operator== ( const QTranslatorMessage & m ) const

143       Returns TRUE if the extended key of this object is equal to that of m;
144       otherwise returns FALSE.
145

bool QTranslatorMessage::operator> ( const QTranslatorMessage & m ) const

147       Returns TRUE if the extended key of this object is lexicographically
148       after that of m; otherwise returns FALSE.
149

bool QTranslatorMessage::operator>= ( const QTranslatorMessage & m ) const

151       Returns TRUE if the extended key of this object is lexicographically
152       after that of m or if they are equal; otherwise returns FALSE.
153

void QTranslatorMessage::setTranslation ( const QString & translation )

155       Sets the translation of the source text to translation.
156
157       See also translation().
158

const char * QTranslatorMessage::sourceText () const

160       Returns the source text of this message (e.g. "&Save").
161
162       Warning: This may return 0 if the QTranslator object is stripped
163       (compressed).
164

QString QTranslatorMessage::translation () const

166       Returns the translation of the source text (e.g., "&Sauvegarder").
167
168       See also setTranslation().
169

void QTranslatorMessage::write ( QDataStream & stream, bool strip = FALSE,

171       Prefix prefix = HashContextSourceTextComment ) const
172       Writes this translator message to the stream. If strip is FALSE (the
173       default), all the information in the message is written. If strip is
174       TRUE, only the part of the extended key specified by prefix is written
175       with the translation (HashContextSourceTextComment by default).
176
177       See also commonPrefix().
178
179

SEE ALSO

181       http://doc.trolltech.com/qtranslatormessage.html
182       http://www.trolltech.com/faq/tech.html
183
185       Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
186       license file included in the distribution for a complete license
187       statement.
188

AUTHOR

190       Generated automatically from the source code.
191

BUGS

193       If you find a bug in Qt, please report it as described in
194       http://doc.trolltech.com/bughowto.html.  Good bug reports help us to
195       help you. Thank you.
196
197       The definitive Qt documentation is provided in HTML format; it is
198       located at $QTDIR/doc/html and can be read using Qt Assistant or with a
199       web browser. This man page is provided as a convenience for those users
200       who prefer man pages, although this format is not officially supported
201       by Trolltech.
202
203       If you find errors in this manual page, please report them to qt-
204       bugs@trolltech.com.  Please include the name of the manual page
205       (qtranslatormessage.3qt) and the Qt version (3.3.8).
206
207
208
209Trolltech AS                    2 February 2007        QTranslatorMessage(3qt)
Impressum