summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-07-01 08:53:23 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-07-02 10:28:25 (GMT)
commit9a90dab23bd1bd37bd4a7aace588896d2ae7e9d9 (patch)
tree17ac2a57b219d6f7f28444e889bc4187bbbb181f /src/corelib/kernel
parentf4f79c42b7086145b59e99d195b6295720b7377a (diff)
downloadQt-9a90dab23bd1bd37bd4a7aace588896d2ae7e9d9.zip
Qt-9a90dab23bd1bd37bd4a7aace588896d2ae7e9d9.tar.gz
Qt-9a90dab23bd1bd37bd4a7aace588896d2ae7e9d9.tar.bz2
add support for attaching meta data to translatable messages
Requirement: QT-457
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qobject.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 9dc25c7..9e87b3b 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -2086,6 +2086,34 @@ void QObject::deleteLater()
\snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 17
+ \section1 Meta Data
+
+ Additional data can be attached to each translatable message.
+ The syntax:
+
+ \tt{//= <id>}
+
+ can be used to give the message a unique identifier to support tools
+ which need it.
+ The syntax:
+
+ \tt{//~ <field name> <field contents>}
+
+ can be used to attach meta data to the message. The field name should consist
+ of a domain prefix (possibly the conventional file extension of the file format
+ the field is inspired by), a hyphen and the actual field name in
+ underscore-delimited notation. For storage in TS files, the field name together
+ with the prefix "extra-" will form an XML element name. The field contents will
+ be XML-escaped, but otherwise appear verbatim as the element's contents.
+ Any number of unique fields can be added to each message.
+
+ Example:
+
+ \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp meta data
+
+ Meta data appearing right in front of a magic TRANSLATOR comment applies to the
+ whole TS file.
+
\section1 Character Encodings
You can set the encoding for \a sourceText by calling QTextCodec::setCodecForTr().