Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to make values stored in QString variables translate to other languages.
hi can anyone say, how to make values stored in QString variables translate to otehr languages ,
i have tried with Qlabel and Qpushbutton using tr(), to translate to other languages.
while reading documentation i came across QT_TR_NOOP(), QT_TRANSLATE_NOOP(). when i made use of QT_TR_NOOP the variables was generated in ts file, i was able to view in Qt Linguist. but the values are not translating so shanyone tell me how to make QString
Ratzz last edited by Ratzz
I have used QT_TR_NOOP which worked.
Pradeep Kumar last edited by Pradeep Kumar
Posting the code , which will be helpfull.
using QT_TR_NOOP the QString value will be shown in Qt Linguist for translating to respective language, but for actual value to be translated and to be reflected in widgets we need to use tr for QString value.
Here is a sample code.
m_label = new QLabel;
appendData = QT_TR_NOOP(tr("First Label"));
We can also use QT_TR_NOOP and QT_TR_NOOP_UTF8.
See here for an example of how to use these macros.
Thanks for the link and info.