Results 1 to 3 of 3

Thread: C++ / Qt5.11 - Translate and QString with HTML included

  1. #1
    Join Date
    Oct 2006
    Posts
    105
    Thanks
    13
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default C++ / Qt5.11 - Translate and QString with HTML included

    Hello,
    Qt Code:
    1. QString text = ( tr( "Select a line, circle or arc<br>" ) );
    2. text.append( tr( "and press <i><b>\"enter/return\"</b></i>.<br>" ) );
    3. text.append( tr( "One entity only!" ) );
    4. msgBox.setText( text );
    To copy to clipboard, switch view to plain text mode 
    Given a QString with embedded HTML, will the tanslate function work or do I have to seperate the text & HTML code ?

    Regards

  2. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    503
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: C++ / Qt5.11 - Translate and QString with HTML included

    Hi, translate will work. You will need to keep the HTML tags in the translation, of course.

    Ginsengelf

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

    jimbo (15th June 2018)

  4. #3
    Join Date
    Oct 2006
    Posts
    105
    Thanks
    13
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: C++ / Qt5.11 - Translate and QString with HTML included

    Hello,

    Quote Originally Posted by Ginsengelf View Post
    Hi, translate will work. You will need to keep the HTML tags in the translation, of course.
    Thanks.

    Regards

Similar Threads

  1. Translate one QString to unicode
    By SirJonas in forum Newbie
    Replies: 1
    Last Post: 18th November 2016, 06:37
  2. Replies: 5
    Last Post: 6th April 2015, 10:14
  3. Qt5.3 tr() needs to translate QString
    By ad5xj in forum Qt Programming
    Replies: 1
    Last Post: 2nd June 2014, 01:48
  4. Replies: 1
    Last Post: 6th December 2011, 23:44
  5. Displaying picture included with html code
    By Djony in forum Qt Tools
    Replies: 1
    Last Post: 27th November 2006, 17:15

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.