You need to wrap all the possible literal strings into QT_TR_NOOP calls apart from using tr for the translation:
QString FriendlyConversation
::greeting(int type
) { static const char *greeting_strings[] = {
QT_TR_NOOP("Hello"),
QT_TR_NOOP("Goodbye")
};
return tr(greeting_strings[type]);
}
QString FriendlyConversation::greeting(int type) {
static const char *greeting_strings[] = {
QT_TR_NOOP("Hello"),
QT_TR_NOOP("Goodbye")
};
return tr(greeting_strings[type]);
}
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.
Bookmarks