Results 1 to 11 of 11

Thread: Localization for dynamically generated text.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Localization for dynamically generated text.

    You need to wrap all the possible literal strings into QT_TR_NOOP calls apart from using tr for the translation:
    Qt Code:
    1. QString FriendlyConversation::greeting(int type) {
    2. static const char *greeting_strings[] = {
    3. QT_TR_NOOP("Hello"),
    4. QT_TR_NOOP("Goodbye")
    5. };
    6. return tr(greeting_strings[type]);
    7. }
    To copy to clipboard, switch view to plain text mode 

    Other than that I would suggest to apply an xsl transformation on your original xml file to make it conformant with Qt's .ts files. Then you just don't need lupdate.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Mar 2009
    Location
    delhi India
    Posts
    56
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows
    Thanks
    1

    Default Re: Localization for dynamically generated text.

    Thanks .
    Could you elaborate more on second point about XSL.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Localization for dynamically generated text.

    Google for XSLT.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Dynamically resize text
    By antialias_forum in forum Qt Quick
    Replies: 4
    Last Post: 6th May 2011, 23:37
  2. Real Time Localization System
    By oswalidos in forum General Programming
    Replies: 3
    Last Post: 22nd September 2009, 19:50
  3. work with web generated xml
    By emental86 in forum Qt Programming
    Replies: 1
    Last Post: 11th February 2009, 13:51
  4. displaying Text in QTAble dynamically
    By raghvendramisra in forum Qt Programming
    Replies: 8
    Last Post: 31st August 2007, 10:47

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.