[Development] QtCS2019 Notes: Clang-based cpp parser for lupdate

Kai Pastor, DG0YT dg0yt at darc.de
Sun Nov 24 10:49:48 CET 2019

Am 22.11.19 um 21:25 schrieb Kai Pastor, DG0YT:
> Am 22.11.19 um 17:03 schrieb Kai Köhne:
>> Keep in mind that you need this context available both at runtime and
>> at lupdate time. That is, the only setup how this IMO would reliably work
>> is if  we make the context a part of the tr() call - effectively calling
>> QCoreApplication::translate(context, string). This is already possible right
>> now.
> I admit I didn't think about the runtime perspective. But
>     QCoreApplication::translate("Context", string)
> is much more verbose then
>     Context::tr(string)
> or, with a declared and defined Context for the translation unit, just
>     tr(string)
One more comment: Sometimes I already have to use what "is already 
possible right now" due to lupdate's C++11 quirks, and in combination 
with the requirement to use a namespace to separate "my" class names 
from 3rd-party library identifiers, the verbose form actually spells:

QCoreApplication::translate("::MyNameSpace::Context", string)

Possible, but hardly bearable...


More information about the Development mailing list