"disappeared" for the "translation" element in TS files

I noticed that some messages in the Qt TS file have a "disappeared" type for their translation items, but its usage is unclear. It seems that only messages in an "unnamed" context are of this type. The corresponding DTD only says that this value was introduced in Qt 5.2 and I cannot find any other documentation.

What is its meaning and when lupdate

does the tool add ? This is something like a "legacy" type, i.e. An old line that doesn't exist in your code? Are these lines present in the .qm file generated lrelease

?

+3


source to share


1 answer


Here's what I learned:

When it lupdate

updates the translated strings in the TS file and no longer finds them in the code, it differentiates them based on their original state (type attribute):

  • If the string had an accepted translation (that is, a type attribute), it is retained, but marked as "disappeared".
  • If the string did not have an accepted translation (i.e. type="unfinished"

    ), it is simply removed from the TS file.


This behavior can be changed by adding a flag -no-obsolete

to lupdate

. In any case, lines with type "disappeared" are not added to the final .qm file on lrelease

, so they will not be translated if they appear in the final application (for example, if they come from an external database).

I suspect that the "legacy" type is no longer used in Qt 5 and is simply maintained as Qt 4 compatibility.

+5


source







All Articles