0
 QTableWidget* table = new QTableWidget();

 QTableWidgetItem *tw_1 = new QTableWidgetItem();
 tw_1->setText(QObject::tr("Table Name"));
 table->setItem(0,0, tw_1);

ru.ts file

<context>
    <name>QTableWidgetItem</name>
    <message>
        <source>Table Name</source>
        <translation>Название таблицы</translation>
    </message>
</context>

Language translation is not working in QTableWidgetItem.. How to use tranlation here..

Senthil Kumar
  • 562
  • 1
  • 6
  • 14

1 Answers1

0

You use QObject::tr("Table Name") and then you should specify QObject in ru.ts file.

<context>
    <name>QObject</name>
    <message>
        <source>Table Name</source>
        <translation>Название таблицы</translation>
    </message>
</context>