Hi all!

I just start reading how to use the translator file and the QTranslator and I need some help to see if what I am doing is any close.

the ts file
Qt Code:
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE TS>
  3. <TS version="2.0" language="de" sourcelanguage="en">
  4. <context>
  5. <name>QObject</name>
  6. <message>
  7. <source>Username</source>
  8. <translation>Benutzername</translation>
  9. </message>
  10. <message>
  11. <source>Password</source>
  12. <translation>Passwort</translation>
  13. </message>
  14. </context>
  15. </TS>
To copy to clipboard, switch view to plain text mode 

Contructor of my class
Qt Code:
  1. QString german = "C:/esp/lang/deutsch.ts"; QTranslator_Language.load(german);
  2. QCoreApplication::installTranslator(&_Language);
  3. ui.label->setText("Username");
  4. ui.label_2->setText("Password");
To copy to clipboard, switch view to plain text mode 

I was expecting that the Username would be translated to "Benutzername" and Password to "Passwort".

I also tried _Language.translate function but didn't work.