Skip to main content
Qt Linguist (.ts)
Nick Ustinov avatar
Written by Nick Ustinov
Updated over 2 weeks ago

Qt Linguist files (.ts) are used for managing translations in Qt applications. These files store translation data in XML format, including support for comments and plurals.

Technical information

Overview

Format name:
Qt Linguist

File extensions:
.ts

Common use cases:
Managing and organizing localization strings in Qt applications.

Technical details:

  • Structure: Qt Linguist .ts files are XML-based and include multiple tags to define translations, comments, and plurals. Each translation unit is encapsulated within <message> tags, with additional metadata provided by other XML tags.

  • Encoding: UTF-8

Example:
Here's an example of a typical Qt Linguist .ts file used for localization:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
<name>MainWindow</name>
<message>
<source>Hello, world!</source>
<translation>Hello, world!</translation>
</message>
<message>
<source>File not found</source>
<translation>File not found</translation>
</message>
</context>
</TS>

In this example, the .ts file includes a context (MainWindow) with multiple message tags, each containing a source string and its corresponding translation.

Using with Lokalise

Lokalise supports Qt Linguist .ts files, allowing you to manage and translate your localization strings efficiently.

Supported project types

Please note that TS files can be uploaded only to Web and mobile projects.

Known limitations and special notes

Lokalise support is based on the Qt Linguist .ts format as defined in the official docs, including comments and plurals.

Unsupported tags:

  • <extracomment> tag (on export)

  • <message> tag (additional attributes may not be fully supported)

  • <location> tags

Did this answer your question?