QTranslatorMessage(3qt)
π QTranslatorMessage β the 3qt manual page, but make it make sense π
okay bestie, welcome to QTranslatorMessage(3qt), the Qt 3 man page you didn't know you needed. it's a translator message and all its little properties. yes it's niche. yes it's iconic. let's get into it πΈ
β¨ NAME β¨
QTranslatorMessage β translator message and its properties. that's the whole vibe, no cap π
π¦ SYNOPSIS π¦
#include <qtranslator.h>
π Public Members π
QTranslatorMessage ()
QTranslatorMessage ( const char * context, const char * sourceText,
const char * comment, const QString & translation = QString::null )
QTranslatorMessage ( QDataStream & stream )
QTranslatorMessage ( const QTranslatorMessage & m )
QTranslatorMessage & operator= ( const QTranslatorMessage & m )
uint hash () const
const char * context () const
const char * sourceText () const
const char * comment () const
void setTranslation ( const QString & translation )
QString translation () const
enum Prefix { NoPrefix, Hash, HashContext, HashContextSourceText,
HashContextSourceTextComment }
void write ( QDataStream & stream, bool strip = FALSE, Prefix prefix =
HashContextSourceTextComment ) const
Prefix commonPrefix ( const QTranslatorMessage & m ) const
bool operator== ( const QTranslatorMessage & m ) const
bool operator!= ( const QTranslatorMessage & m ) const
bool operator< ( const QTranslatorMessage & m ) const
bool operator<= ( const QTranslatorMessage & m ) const
bool operator> ( const QTranslatorMessage & m ) const
bool operator>= ( const QTranslatorMessage & m ) const
look at that list. gorgeous. πβ¨
π DESCRIPTION π
the QTranslatorMessage class holds a translator message and its properties. it's giving "package deal". π
ngl, this class is of no interest to most applications. it's for translation tools like Qt Linguist. the reason it exists at all is simply to make the API complete and regular. so if you're not building translation tooling, you can scroll, bestie. π
so here's the tea for a QTranslator object: a lookup key is a triple β (context, source text, comment) β and it uniquely identifies a message. an extended key is a quadruple β (hash, context, source text, comment) β where the hash is computed from the source text and the comment. unless you're planning to read and write messages yourself, you do not need to worry about the hash value, fr fr.
QTranslatorMessage stores this triple or quadruple, plus the relevant translation if there is any. π«Ά
see also QTranslator, Environment Classes, and Internationalization with Qt.
π Member Type Documentation π
QTranslatorMessage::Prefix
let (h, c, s, m) be the extended key. the possible prefixes are:
QTranslatorMessage::NoPrefixβ no prefix. nothing. empty. the void. πQTranslatorMessage::Hashβ only(h)QTranslatorMessage::HashContextβ only(h, c)QTranslatorMessage::HashContextSourceTextβ only(h, c, s)QTranslatorMessage::HashContextSourceTextCommentβ the whole extended key,(h, c, s, m)π
see also write() and commonPrefix().
π§ MEMBER FUNCTION DOCUMENTATION π§
QTranslatorMessage::QTranslatorMessage ()
constructs a translator message with the extended key (0, 0, 0, 0) and QString::null as translation. starting from zero, main character origin story β¨
QTranslatorMessage::QTranslatorMessage ( const char * context, const char * sourceText, const char * comment, const QString & translation = QString::null )
constructs an translator message with the extended key (h, context, sourceText, comment), where h is computed from sourceText and comment, and possibly with a translation. (yes, the original really says "an translator message" β we keep the facts exactly as they are, periodt. π
)
QTranslatorMessage::QTranslatorMessage ( QDataStream & stream )
constructs a translator message read from the stream. the resulting message may have any combination of content. surprise bag energy π
see also QTranslator::save().
QTranslatorMessage::QTranslatorMessage ( const QTranslatorMessage & m )
constructs a copy of translator message m. twin behavior, obsessed π
const char * QTranslatorMessage::comment () const
returns the comment for this message (e.g. "File|Save").
β οΈ Warning: this may return0if theQTranslatorobject is stripped (compressed). so likeβ¦ check before you dereference, bestie π
Prefix QTranslatorMessage::commonPrefix ( const QTranslatorMessage & m ) const
returns the widest lookup prefix that is common to this translator message and to message m.
for example, if the extended key for this message is (71," PrintDialog", "Yes", "Print?") and that for m is (71," PrintDialog", "No", "Print?"), this function returns HashContext.
see also write().
const char * QTranslatorMessage::context () const
returns the context for this message (e.g. "MyDialog").
β οΈ Warning: this may return0if theQTranslatorobject is stripped (compressed). same warning, same energy π«
uint QTranslatorMessage::hash () const
returns the hash value used internally to represent the lookup key. this value is zero only if this translator message was constructed from a stream containing invalid data.
the hashing function is unspecified, but it will remain unchanged in future versions of Qt. so it's mysterious but loyal. iykyk π
bool QTranslatorMessage::operator!= ( const QTranslatorMessage & m ) const
returns TRUE if the extended key of this object is different from that of m; otherwise returns FALSE.
bool QTranslatorMessage::operator< ( const QTranslatorMessage & m ) const
returns TRUE if the extended key of this object is lexicographically before than that of m; otherwise returns FALSE. (again, "before than" β verbatim, don't come for me π)
bool QTranslatorMessage::operator<= ( const QTranslatorMessage & m ) const
returns TRUE if the extended key of this object is lexicographically before that of m or if they are equal; otherwise returns FALSE.
QTranslatorMessage & QTranslatorMessage::operator= ( const QTranslatorMessage & m )
assigns message m to this translator message and returns a reference to this translator message. give it back, that's the rule π
bool QTranslatorMessage::operator== ( const QTranslatorMessage & m ) const
returns TRUE if the extended key of this object is equal to that of m; otherwise returns FALSE.
bool QTranslatorMessage::operator> ( const QTranslatorMessage & m ) const
returns TRUE if the extended key of this object is lexicographically after that of m; otherwise returns FALSE.
bool QTranslatorMessage::operator>= ( const QTranslatorMessage & m ) const
returns TRUE if the extended key of this object is lexicographically after that of m or if they are equal; otherwise returns FALSE.
void QTranslatorMessage::setTranslation ( const QString & translation )
sets the translation of the source text to translation. glow up complete π
see also translation().
const char * QTranslatorMessage::sourceText () const
returns the source text of this message (e.g. "&Save").
β οΈ Warning: this may return0if theQTranslatorobject is stripped (compressed). third time's the charm, bestie π
QString QTranslatorMessage::translation () const
returns the translation of the source text (e.g., "&Sauvegarder"). trΓ¨s bien β¨
see also setTranslation().
void QTranslatorMessage::write ( QDataStream & stream, bool strip = FALSE, Prefix prefix = HashContextSourceTextComment ) const
writes this translator message to the stream. if strip is FALSE (the default), all the information in the message is written. if strip is TRUE, only the part of the extended key specified by prefix is written with the translation (HashContextSourceTextComment by default).
see also commonPrefix().
πΈ SEE ALSO πΈ
π COPYRIGHT π
copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. see the license file included in the distribution for a complete license statement.
π¦ AUTHOR π¦
generated automatically from the source code. (not a human, just vibes π«Ά)
π BUGS π
if you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. good bug reports help us to help you. thank you.
the definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. this man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech.
if you find errors in this manual page, please report them to qt-bugs@trolltech.com. please include the name of the manual page (qtranslatormessage.3qt) and the Qt version (3.3.8).
okay that's the whole page, bestie, you ate it up π
this version of QTranslatorMessage(3qt) came from Trolltech AS, dated 2 February 2007 β and honestly? iconic behavior for a man page. mwah, go forth and translate responsibly πβ¨π
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms