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 ?
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 ?
Are these your own XML files or are you loading QtDesigner .ui files via QUiLoader?
Cheers,
_
NO, GUI's character is stored in the xml files, NOT in the source code , and I designed all the GUI by C++
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 .
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,
_
Yes , just as your said
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,
_
Bookmarks