bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Support for native Qt plurals by Gettext?


From: Chusslove Illich
Subject: Support for native Qt plurals by Gettext?
Date: Fri, 5 Dec 2008 16:59:14 +0100
User-agent: KMail/1.9.5

Qt since 4.2 actually has native support for plural forms (I wasn't aware of
this when we discussed qt-format/kde-format issues earlier), but somewhat
different in concept than Gettext's:

http://www.system-linux.net/doc/qt4/doc/html/qobject.html#tr

http://doc.trolltech.com/qq/qq19-plurals.html

The rationale for supplying single message string seems to be that it is
neutral towards the language used in the source, and that there should be a
translation in that language too, if "more natural" text is sought (e.g. for
English source messages, English translation with at least the plural
messages translated into the usual two forms). Another thing is that if the
number is negative, then the call is not considered plural at all:

  QString msg = tr("%n bird(s)", "", 10); // plural call
  QString msg = tr("%1 bird(s)", "", -1).arg(10); // ordinary call

Furthermore, as above, the context, even if empty, must be supplied due to
argument ordering (cf. my recent message on empty contexts).

So, the question is: should/could this (or a part of it) be supported by
xgettext? Obvious mapping would be to extract the single string as both
msgid and msgid_plural in POT, but details past that make me dizzy.

-- 
Chusslove Illich (Часлав Илић)

Attachment: pgpBTAScuLtPv.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]