Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
2.3.3
-
None
Description
This is a clone of https://bugreports.qt.io/browse/QTVSADDINBUG-281 since the original issue still persists with Qt VS Add-In 2.3.3 and Visual Studio 2019.
The bug happens when using tr() inside a namespace and the source and header files are located in different directories.
I attached a Visual Studio project showing the problem.
In the attached project lupdate reports
C:/Temporary/LUpdateTest/src/LUpdateTest/LUpdateTest.cpp:11: Qualifying with unknown namespace/class ::LUpdateTest
for the following source (LUpdateTest.cpp):
#include "LUpdateTest.h" namespace Namespace { LUpdateTest::LUpdateTest(QWidget *parent) : QDialog(parent) { ui.setupUi(this); ui.label->setText(tr("Translation here")); } }
lupdate_de.ts contains
<context> <name>LUpdateTest</name> <message> <location filename="../../src/LUpdateTest/LUpdateTest.cpp" line="11"/> <source>Translation here</source> <translation>Übersetzung hier</translation> </message> </context>
The name tag contains "LUpdateTest" but it should be "Namespace::LUpdateTest".