-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.9.2
-
None
-
fbaba6941 (18.0)
Unfortunately lupdate now misdetects the context wrt namespace differently than it did in Qt 6.9.2
In Qt Creator we use one "Tr" struct per plugin to consolidate all translations/tr-calls from that plugin. The struct is always called "Tr", has the "Q_DECLARE_TR_FUNCTIONS" macro and lives in the plugin namespace. E.g.
https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/src/plugins/coreplugin/coreplugintr.h
https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/src/plugins/cppeditor/cppeditortr.h
Normally we only use the "Tr" struct from that plugin, but sometimes a plugin uses a translation from a different plugin, e.g. some project management plugins use some common translations from the ProjectExplorer plugin.
With Qt 6.9.2 the following situation fails to correctly determine the correct translation context/namespace:
#include "cppeditortr.h" #include <coreplugin/coreplugintr.h> using namespace Core; namespace CppEditor::Internal { ... Tr::tr("this should be CppEditor::Tr") ... ::Core::Tr::tr("this is Core::Tr") ... } // namespace CppEditor::Internal
In this case the plain Tr::tr should be resolved as CppEditor::Tr::tr, but the translations is wrongly assigned to the Core::Tr context.
Qt 6.9.1 still works. I guess this was an unnoticed side-effect of the fix for QTBUG-136768
- resulted from
-
QTBUG-136768 Mis-detection of namespaces
-
- Closed
-
For Gerrit Dashboard: QTBUG-140548 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
679809,6 | Avoid including multiple Tr classes | 18.0 | qt-creator/qt-creator | Status: MERGED | +2 | +1 |