Linguist not showing ID in ID-based mode
-
I want to used ID-based localization in my CMAKE project. If I just call
qtTrId("id-example")
the Linguist will show a rather useless line "? ? <header file>
". If there are ten such lines I can't figure out what am I translating (unless I edit the file in some text editor). So I am forced to repeat the ID in the code://: id-example QString e = qtTrId("id-example");
Is there a way to make the Linguist show the ID? Why would Linguist hide this essential information? Qt is in version 6.6.3.
-
-
Two weeks passed without a response. Is this a known issue that gets asked all the time? Is there no way to see the ID in the Linguist?
-
A simple main.cpp with a qtTrId() works fine here.
Please provide a minimal, compilable example of your problem. -
@Dialecticus said in Linguist not showing ID in ID-based mode:
Two weeks passed without a response.
I guess that a lot of people are not using id-based translations (I personally don't). Therefore, there are not many who can speak from experience.
-
So, I investigated the matter. I have
LUPDATE_OPTIONS -locations none
in CMakeLists.txt. I have to have it. The Linguist freezes if I click on any visual context. This is a known issue in Windows. But my question is not why I don't see the location of the resource. I don't care for location, hence the LUPDATE_OPTIONS option. The question is why I don't see the identifier of the resource. -
The translation ID is indeed not visible if locations are disabled. I've created https://bugreports.qt.io/browse/QTBUG-129392 to track this.
The "Linguist hangs on Windows issue" (https://bugreports.qt.io/browse/QTBUG-127139) is fixed for 6.8.0, which will be released soon.
Two workarounds for QTBUG-127139 come to mind:
Remove the QtWebView via the installer or install a separate Qt build without this plugin (e.g., a MinGW build of Qt).Use Linguist from that QtWebView-less Qt and remove the
-locations none
option. Then you should see translation IDs in all their glory.