QT Linguist (ts)

Qt Linguist uses TS (Translation Source) XML files to manage localization for Qt-based applications built with Qt Widgets or Qt Quick. The lupdate tool extracts translatable strings from C++ and QML source into .ts files; lrelease compiles them into binary .qm files loaded at runtime.

Qt TS files are XML files containing context elements, each corresponding to a source file or logical grouping. Each context contains message elements with a source element (original text) and a translation element (translated text). Comments and disambiguation hints use the comment element. Translation status is tracked with a type attribute — unfinished, vanished, or obsolete — to manage the update lifecycle.

Best practice: use the tr() function consistently for all user-visible strings in C++ and qsTr() in QML. Provide disambiguation text using the tr() context parameter when the same English string requires different translations in different contexts. Run lupdate regularly to keep .ts files in sync with source code changes — vanished strings are preserved and can be recovered if accidentally removed. Language Monster supports Qt Linguist TS format and handles context elements and translation status tracking.

Read More File Formats