-
Bug
-
Resolution: Won't Do
-
P3: Somewhat important
-
None
-
6.3.0
-
None
The fix for QTBUG-91521 introduces the following issue.
Consider this code:
FooBar::Type freeFunction()
{
tr("freeFunction");
}
That produces now
<context>
<name>FooBar</name>
<message>
<location filename="testbackendname.cpp" line="18"/>
<source>freeFunction</source>
<translation type="unfinished"></translation>
</message>
</context>
The text should not appear at all. Instead, lupdate should produce a warning like this:
filename.cpp:18: tr() cannot be called without context
Given that the code above is unlikely to exist, this is quite an edge case.
However, introducing such a regression is less than nice.
This was found when investigating why QTBUG-99415 is fixed in Qt 6.3.0.
Note that the context is correct for cases like:
class Foo {
public:
Narf::Zort f() { tr("some text"); } // context is Foo
};
- relates to
-
QTBUG-99415 lupdate ignores tr() call in a function with noexcept operator
-
- Closed
-
- resulted from
-
QTBUG-91521 When calling lupdate on a file that uses QT_TR_NOOP in a constructor for a static QString it will fail to find the context
-
- Closed
-