qt-linguist

"vanished" type for the "translation" element in the TS files


I noticed that some messages in a Qt TS file have a "vanished" type for their translation elements, but its use is not clear. It seems that only messages in the "unnamed" context have this type. The corresponding DTD only says that this value was introduced in Qt 5.2 and I can't find any other documentation.

What is its meaning and when does the lupdate tool add it? Is it something similar to the "obsolete" type, i.e. an old string no more existing in the code? Are these strings present in the .qm file generated by lrelease?


Solution

  • Here is what I found out:

    When lupdate updates the translated strings in the TS file and does not found them anymore in the code, it distinguishes them depending on their initial status (the "type" attribute):

    This behaviour can be modified adding the -no-obsolete flag to lupdate. In any case, the strings with type "vanished" are not added to the final .qm file by lrelease, so they will not be translated if they appear in the final application (e.g. if coming from an external database).

    I suspect that the "obsolete" type is not used anymore in Qt 5 and just kept as compatibility with the Qt 4.