I'm trying to translate my app and the only thing that i can translate is the Qt texts with loading "qt_pt.qm" but when I try to load my "app.qm" the text doesn't get translated.

I've tried everything i know, but it isn't working.

So, made another project and tried to translate words in Console App, same problem.

Can you help me ?

This is the .ts file:

Qt Code:
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE TS>
  3. <TS version="2.0" language="pt" sourcelanguage="en">
  4. <context>
  5. <name></name>
  6. <message>
  7. <source>old</source>
  8. <translation>velho</translation>
  9. </message>
  10. <message>
  11. <source>novo</source>
  12. <translation>new</translation>
  13. </message>
  14. </context>
  15. </TS>
To copy to clipboard, switch view to plain text mode 

This is my code:

Qt Code:
  1. #include <QtCore/QCoreApplication>
  2. #include <QTranslator>
  3. #include <QDebug>
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7. QCoreApplication a(argc, argv);
  8.  
  9. qDebug() << "loaded: " << tr->load("translator.qm", "C:\\C++\\Qt Projects\\Translator\\Translator");
  10.  
  11. qDebug() << "------------------";
  12. qDebug() << QObject::tr("old");
  13. qDebug() << QObject::tr("velho");
  14. qDebug() << QObject::tr("new");
  15. qDebug() << QObject::tr("novo");
  16. qDebug() << "------------------";
  17.  
  18. a.installTranslator(tr);
  19.  
  20. qDebug() << "------------------";
  21. qDebug() << QObject::tr("old");
  22. qDebug() << QObject::tr("velho");
  23. qDebug() << QObject::tr("new");
  24. qDebug() << QObject::tr("novo");
  25. qDebug() << "------------------";
  26.  
  27. return a.exec();
  28. }
To copy to clipboard, switch view to plain text mode 

and I get this output:

Qt Code:
  1. loaded: true
  2. ------------------
  3. "old"
  4. "velho"
  5. "new"
  6. "novo"
  7. ------------------
  8. ------------------
  9. "old"
  10. "velho"
  11. "new"
  12. "novo"
  13. ------------------
To copy to clipboard, switch view to plain text mode 

It doesn't translate my text, link in my App, what I can do ?
What is wrong in the code ?
What I need to do to fix it ?

(Using Qt 4.7.2)