[Qt-interest] Translating a xml file using lupdate

Konstantin Tokarev annulen at yandex.ru
Tue Sep 13 19:23:08 CEST 2011


13.09.2011, 14:47, "Jordan Tcolov" <mazzzterz at gmail.com>:
> Just after I posted I found another solution.
>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <buttons_definitions>
>> <buttons>
>>
>> <!-- Two state buttons -->
>>     <button id="0" name="POS">
>>         <text0>QT_TRANSLATE_NOOP("XML_Buttons", "Position")</text0>
>>     </button>
>>
>>     <button id="1" name="PROGRAM">
>>         <text0>QT_TRANSLATE_NOOP("XML_Buttons", "Program")</text0>
>>     </button>
>>
>> </buttons>
>> </buttons_definitions>
>
> It's better than the previous and I just have to remove QT_TRANSLATE_NOOP from the string when reading it which isn't that much of work, but I want to ask if there is anyway that I can point lupdate that I want to translate text between the tags <text0></text0>, <text1></text1>, <text2></text2> and so ?

You can borrow solution used in Qt Creator, i.e. generate from your XMLs fake source file using XQuery script, and feed it to lupdate.

-- 
Regards,
Konstantin



More information about the Qt-interest-old mailing list