Results 1 to 3 of 3

Thread: QTranslator is not working in autostart!

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2010
    Posts
    23
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QTranslator is not working in autostart!

    Hey everybody,

    I'm using translations in my program the following way:
    Qt Code:
    1. QString locale = QLocale::system().name();
    2. QTranslator translator;
    3. translator.load("Program_" + locale);
    4. app.installTranslator(&translator);
    To copy to clipboard, switch view to plain text mode 

    This code appears in main.cpp after creating the QApplication and before executing it. When opening the program at a later point everything works fine, but my program can "start with windows", if the user likes that. In order to make this happen I added a key in registry-key in "HKCU/Software/Microsoft/Windows/CurrentVersion/Run". The program starts as expected, but the translation is missing. I read, that installing the translator in main.cpp is too early, but it works fine starting the program manually some seconds after windows started.

    Maybe it actually is too early to install the translation in autostart, but I can't figure out why, even installing the language directly is not showing any effect:
    Qt Code:
    1. translator.load("Program_de");
    2. app.installTranslator(&translator);
    To copy to clipboard, switch view to plain text mode 

    It this a bug in Qt or is it really to early in autostart? Why? If it's too early , how can I install the translation at a later point?

    Thanks alot for your help,

    MisterIKS

  2. #2
    Join Date
    Apr 2010
    Posts
    23
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTranslator is not working in autostart!

    This morning I installed Qt Creator 2.0 on my computer, and after building the first time with it there was no translation at all anymore, not even when starting the program manually.

    I can't fix any of these problems, because I don't even know why it's not working. So if you have any general hint or tip on why translations may not work as expected, I'd be greatful!

  3. #3
    Join Date
    Apr 2010
    Posts
    23
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTranslator is not working in autostart!

    It's not right, that the translation does not work at all, it does not when I'm in debugging-mode in QtCreator, running the exe directly still shows the translation!

Similar Threads

  1. Help with QTranslator
    By aarelovich in forum Qt Programming
    Replies: 1
    Last Post: 24th July 2009, 22:38
  2. Want to use QTranslator
    By santhoshv84 in forum Qt Programming
    Replies: 1
    Last Post: 27th August 2008, 15:13
  3. QDesigner + Qtranslator + QComboBox
    By Atikae in forum Qt Programming
    Replies: 3
    Last Post: 11th July 2008, 15:41
  4. Switch QTranslator at runtime?
    By whitefurrows in forum Qt Programming
    Replies: 22
    Last Post: 6th November 2006, 11:32
  5. Mac OS X UI not working
    By hvengel in forum Qt Programming
    Replies: 3
    Last Post: 1st April 2006, 01:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.