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

Kai Pastor, DG0YT dg0yt at darc.de
Fri Nov 22 07:21:25 CET 2019


Am 21.11.19 um 20:23 schrieb André Pönitz:
> On Thu, Nov 21, 2019 at 07:48:41PM +0100, Oswald Buddenhagen wrote:
>> a more radical and much simpler approach would be switching to gettext
> The most prominent difference is the (usually) per-class automatic context
> which I always found too clever to be sensible, and that's effectively
> also the only reason to need a C++ parser.

Indeed, while 'context' is a useful concept, the (implementation) class 
name often isn't the best 'context' from a more general point of view 
(features, human translators, screenshots). And if a class does not 
inherit from QObject, the context already needs to be declared explicitly.

Given the Qt Creator example, would it be feasible to make explicit 
declaration of a file's context mandatory, at least for the existing 
("fast") parser? If not mandatory, an explicit declaration could at 
least disable all automatic detection for the rest of the file, making 
it possible to use modern C++ without surprises.

Maybe this could be complemented by a lconvert feature to rename a 
context in an existing ts-file, for those who want to move away from 
class names as contexts.




More information about the Development mailing list