Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.4.2, 5.5.0
-
None
-
69984af8d5465feb9532823f112f322d5404cc15
Description
When the condition for a ternary operator contains a period, translator comments are not used. Given the example below the produced XML lists the comment for the second condition and not the first. The expected behaviour would be that both translator comments end up in the output.
void test() { const auto var = obj.condition? //: Insert comment here QObject::tr("success AAA") : QObject::tr("failure AAA"); const auto var2 = condition? //: Insert comment here QObject::tr("success BBB") : QObject::tr("failure BBB"); }
TS output:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.1"> <context> <name>QObject</name> <message> <source>success AAA</source> <translation type="unfinished"></translation> </message> <message> <source>failure AAA</source> <translation type="unfinished"></translation> </message> <message> <source>success BBB</source> <extracomment>Insert comment here</extracomment> <translation type="unfinished"></translation> </message> <message> <source>failure BBB</source> <translation type="unfinished"></translation> </message> </context> </TS>