Results 1 to 3 of 3

Thread: Some dialog boxes do not get translated

  1. #1
    Join Date
    Dec 2008
    Location
    Paris, France
    Posts
    34
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Question Some dialog boxes do not get translated

    Hi all,

    Something strange is occurring in the latest releases of my project: when displaying the dialog boxes, some show up translated and some do not. There doesn't appear to be any logic. All the translations in the .ts files seem good - I've checked them in the text editor. There are no error messages during the lrelease command, nor at run time.
    All classes inherit the Q_OBJECT macro.
    The same behaviour occurs in linux and windows.

    Any suggestions ???

    Thanks,

    Andre

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Some dialog boxes do not get translated

    Do you talk about self generated dialogs or about the Qt standard dialogs? For the later you have to include also the Qt specific qm file beside yours.

  3. #3
    Join Date
    Dec 2008
    Location
    Paris, France
    Posts
    34
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Some dialog boxes do not get translated

    Not it's my personal classes which are not translated. I finally understood which get translated and which do not, but still havn't found the fix.
    Those which get translated are the dialog instances declared as member variables of a class.
    Those which do not are ths which are constructed on the heap

    Qt Code:
    1. void MyClass::MyFunction()
    2. {
    3.  
    4. }
    To copy to clipboard, switch view to plain text mode 


    Added after 5 minutes:


    Not it's my personal classes which are not translated. I finally understood which get translated and which do not, but still havn't found the fix.
    Those which get translated are the dialog instances declared as member variables of a class.
    Qt Code:
    1. void MyClass::MyFunction()
    2. {
    3. m_dlg;//declared as a member variable
    4. m_dlg.exec(); //shows up translated
    5. }
    To copy to clipboard, switch view to plain text mode 
    Those which do not are ths which are constructed on the heap
    Qt Code:
    1. void MyClass::MyFunction()
    2. {
    3. MyDialog dlg;
    4. dlg.exec(); //shows up not translated
    5. }
    To copy to clipboard, switch view to plain text mode 

    Any ideas ? Been stuck with this for several months now
    Last edited by Windsoarer; 14th May 2011 at 11:19.

Similar Threads

  1. Not all Widgets are Translated
    By Halcom in forum Qt Programming
    Replies: 8
    Last Post: 6th December 2010, 08:52
  2. Replies: 0
    Last Post: 29th September 2009, 11:31
  3. Resizable layout boxes
    By NOR in forum Newbie
    Replies: 3
    Last Post: 16th April 2008, 14:48
  4. Resizing the dialog boxes
    By anju123 in forum Qt Programming
    Replies: 4
    Last Post: 14th September 2007, 10:41
  5. Translated plugins
    By Illuminnator in forum Qt Programming
    Replies: 1
    Last Post: 25th January 2007, 17:34

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.