We have a CMake Qt project (plain widgets, no QML). Right now it has only one MainWindow with menu and some controls. Initially translation was done with a default plain-text-based mechanism. We now want to turn the project to text-ID-based mechanism. We have valid reasons, and this needs to happen. I added the option -idbased to qt_add_translations(... LRELEASE_OPTIONS ...) in CMakeLists.txt file.
I understood that in text-ID-based mechanism there are no contexts, yet in function Ui_MainWindow::retranslateUi I still see bunch of lines like this one (that were there before I added the -idbased option):
menuHelp->setTitle(QCoreApplication::translate("MainWindow", "id-help", nullptr));
So, menu item Help has text ID "id-help" in translation context "MainWindow", which makes no sense to me. Are my expectations wrong, or am I doing something wrong? How to make the Qt Creator generate "contextless" translation entries?
I think you need
menuHelp->setTitle(QCoreApplication::translate("id-help", nullptr));There should be no "MainWindow" context specified.This is a minimal example: