QTranslatorMessage(3qt)

πŸ“¦ version 3.3.8b, in fedora 43, fedora 44

πŸ’– 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 return 0 if the QTranslator object 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 return 0 if the QTranslator object 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 return 0 if the QTranslator object 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 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