qtqt5qtranslateqt-linguist

QTranslator Linguist: Are line numbers required?


I used that example here

There you can see line numbers, for all location tags. I do not want to use linenumbers, since they might change from time to time.

When I open the *.ts file in the Linguist, the *.ui is shown there as well, as you can see here: green area is the UI Widget

The green area is the UI Widget displayed in the Linguist (actually the same view as in the QtCreator Designer).

With that line numbers it is working. Without, not, Why? I do not want to maintenance line numbers in translation files.

(Similar questions: handling ampersands https://stackoverflow.com/questions/33422473/qtranslator-with-linguist-file-not-translatable)


Solution

  • These line numbers are needed for QtLinguist to properly highlight code snippets for which translations are made. They mustn't be updated by hand each time. There is special utility for this purpose - lupdate, which updates your *.ts files due to new code changes.

    You can get more details about internationalization from this great article

    UPD: Feel free to address me more questions in comments, if something is still unclear.