Hi:

I'm trying my hand at a little internationalization and I wanted to start with a simple app and two languages: english and spanish. I managed to succesfully load the spanish packet and saw everything in my application as it should. Next I wanted to implement a bit of code so that the user could choose the language at the program startup since changing it on the fly is apparently pretty complicated. Since I only had two options I tried this in main.cpp.

Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication a(argc, argv);
  4. LanguageDialog diag; \\
  5. diag.exec(); \\
  6. if (diag.shouldTranslate()){\\
  7. QTranslator translator;
  8. translator.load(QString("mastermind_es"));
  9. a.installTranslator(&translator);
  10. }\\
  11. Mastermind w;
  12. w.show();
  13. return a.exec();
  14. }
To copy to clipboard, switch view to plain text mode 

And it doesn't work. Nothing gets translated no matter what I choose and I've allready checked, I effectively enter the if sentence in spanish is chosen in the diag object.
If the lines with a \\ are commented then I get my app translated (everytime) obviously.

Can anyone tell me what I'm doing wrong?

Thanks for any help in advance.