Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22

Thread: QTranslator??

  1. #21
    Join Date
    Nov 2009
    Posts
    59
    Thanks
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTranslator??

    Quote Originally Posted by ChrisW67 View Post
    Dead easy... I really cannot see the problem
    Qt Code:
    1. $ cd /tmp
    2. $ cp -r /usr/share/qt4/examples/linguist/hellotr .
    3. $ cd hellotr
    4. $ qmake
    5. $ make
    6.  
    7. $ lupdate hellotr.pro
    8. ...
    9. Updating 'hellotr_la.ts'...
    10. Found 1 source text(s) (1 new and 0 already existing)
    11. $ linguist hellotr_la.ts # translate the string
    12. $ lrelease hellotr.pro
    13. ...
    14. Updating '/tmp/hellotr/hellotr_la.qm'...
    15. Generated 1 translation(s) (1 finished and 0 unfinished)
    16. $ ./hellotr
    To copy to clipboard, switch view to plain text mode 
    thanks
    Qt Code:
    1. bool loadReturn=translator.load(locale);
    To copy to clipboard, switch view to plain text mode 
    loadReturn=false. So it can translate.
    Why is loadReturn =flase not true???
    mycomputer can't run above commands.
    Last edited by nthung; 15th October 2011 at 03:07.

  2. #22
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QTranslator??

    That code doesn't appear in the hellotr example. Anyway, upon reading the friendly manual (QTranslator::load()) I discover that:
    Loads filename + suffix (".qm" if the suffix is not specified), which may be an absolute file name or relative to directory. Returns true if the translation is successfully loaded; otherwise returns false.
    What is the value of the variable locale? Does it correspond to a *.qm file?
    Last edited by ChrisW67; 15th October 2011 at 03:51.

  3. The following user says thank you to ChrisW67 for this useful post:

    nthung (15th October 2011)

Similar Threads

  1. QTranslator is not working in autostart!
    By MisterIKS in forum Qt Programming
    Replies: 2
    Last Post: 27th June 2010, 08:36
  2. Help with QTranslator
    By aarelovich in forum Qt Programming
    Replies: 1
    Last Post: 24th July 2009, 22:38
  3. Want to use QTranslator
    By santhoshv84 in forum Qt Programming
    Replies: 1
    Last Post: 27th August 2008, 15:13
  4. QDesigner + Qtranslator + QComboBox
    By Atikae in forum Qt Programming
    Replies: 3
    Last Post: 11th July 2008, 15:41
  5. Switch QTranslator at runtime?
    By whitefurrows in forum Qt Programming
    Replies: 22
    Last Post: 6th November 2006, 11:32

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.