How to get the translations from ID based qm files?
-
Hi,
I can get the translation of tr() based, from the qm files by loading in to QTranslator and using QTranslator::translate(args) function.
But how can i get the translations of ID based qm files. -
Hi
Via qsTrId or the other functions.
https://doc.qt.io/qt-5/linguist-id-based-i18n.html -
yes,
I used qsTrId in the cpp or qt and generated ts files and qm files.
I need to read like QTranslator:translate(args).
Is there anthing like this to read the translations from qm files? -
Hi
Im not sure what you mean 100%
translate(const char *context, const char *sourceText, const char *disambiguation = nullptr, int n = -1) constsince ID based do not have a context, so not sure what you are looking for besides qsTrId() to translate something.
-
I need to verify and confirm that the translations exist in qm files.
WIthout ID based ("tr()"), i'm able to verify by using translate function,
but i don't know how to verify when i used ID based transaltions ("qsTrId()"). -
Hi
Im not sure either as we look up by id.
so we have no source text to compare to.But you can have it add say "! " in front of non translated text so you can mark it thaat way, if that is helpful
to your case.