Results 1 to 7 of 7

Thread: How to implement i18N whiling generating the GUI dynamically ?

  1. #1
    Join Date
    Dec 2016
    Posts
    8
    Qt products
    Qt5 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    Unix/X11 Windows Android

    Default How to implement i18N whiling generating the GUI dynamically ?

    We want to generating the GUI dynamically through reading XML files, and at the same time ,the GUI should support i18N , so , the linguist method CAN NOT be implemented .

    How to ?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to implement i18N whiling generating the GUI dynamically ?

    Are these your own XML files or are you loading QtDesigner .ui files via QUiLoader?

    Cheers,
    _

  3. #3
    Join Date
    Dec 2016
    Posts
    8
    Qt products
    Qt5 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    Unix/X11 Windows Android

    Default Re: How to implement i18N whiling generating the GUI dynamically ?

    NO, GUI's character is stored in the xml files, NOT in the source code , and I designed all the GUI by C++

  4. #4
    Join Date
    Dec 2016
    Posts
    8
    Qt products
    Qt5 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    Unix/X11 Windows Android

    Default Re: How to implement i18N whiling generating the GUI dynamically ?

    the XML files are also designed by us , the C++ code generates the GUI according to the XML files. We don''t use the QtDesigner .

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to implement i18N whiling generating the GUI dynamically ?

    Ok, let me see if I understood that correctly.

    * you have XML based descriptions of UI
    * you have custom C++ code that loads such an XML and created QtWidgets accordingly
    * the XML document contains text that should appear translated

    Cheers,
    _

  6. #6
    Join Date
    Dec 2016
    Posts
    8
    Qt products
    Qt5 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    Unix/X11 Windows Android

    Default Re: How to implement i18N whiling generating the GUI dynamically ?

    Yes , just as your said

  7. #7
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to implement i18N whiling generating the GUI dynamically ?

    In order to get the strings for translation you need to extract them from the XML files.

    You could write a tool like lupdate that does that and updates a Qt translation file, or generate a dummy cpp file that contains the strings in the QT_TR_NOOP macros and call lupdate on that.

    Your loader needs to pass the loaded strings through the tr() function so that the translation lookup can find them.

    Cheers,
    _

Similar Threads

  1. Replies: 0
    Last Post: 30th November 2010, 13:45
  2. A problem about i18n
    By FinderCheng in forum Qt Programming
    Replies: 4
    Last Post: 16th October 2009, 08:15
  3. I18n several libraries
    By ghorwin in forum Qt Programming
    Replies: 1
    Last Post: 24th April 2009, 13:43
  4. PyQt and i18n, only "half of it" is translated
    By NebuK in forum Qt Programming
    Replies: 21
    Last Post: 25th January 2008, 10:37
  5. qss and i18n
    By KrishnaKishan in forum Qt Programming
    Replies: 1
    Last Post: 13th June 2007, 17:54

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.