Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

qt-linguist

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?

like image 622
Rusty Gear Avatar asked Aug 04 '15 11:08

Rusty Gear


1 Answers

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):

  • If the string had an accepted translation (i.e. no type attribute), it is kept, but marked as "vanished".
  • If the string had no accepted translation (i.e. type="unfinished"), it is simply removed from the TS file.

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.

like image 124
Rusty Gear Avatar answered Nov 06 '22 04:11

Rusty Gear