<a id="qtling"></a>

# Qt Linguist .ts

<a id="index-0"></a>

Translation format used in Qt based applications.

Qt Linguist files are used as both bilingual and monolingual translations.
Weblate supports both the current version 2 format and the legacy version 1
format. Select the file format matching the version produced by your
application.

#### SEE ALSO
* [Qt Linguist manual](https://doc.qt.io/qt-6/qtlinguist-index.html)
* [Qt .ts](https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/ts.html)
* [Bilingual and monolingual formats](https://docs.weblate.org/en/latest/formats.md#bimono)

## Version 2

This is the default format for `.ts` files and supports the full set of Qt
Linguist features available in Weblate.

Example file:

```xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="cs">
<defaultcodec>UTF-8</defaultcodec>
<context>
    <name></name>
    <message weblate-flags="c-format, max-length:100">
        <source>Hello, world!
</source>
        <translation>Ahoj svete!
</translation>
    </message>
    <message numerus="yes">
        <source>Orangutan has %d banana(s).
</source>
        <translation type="unfinished">
            <numerusform />
            <numerusform />
            <numerusform />
        </translation>
    </message>
</context>
<context>
    <name>Second</name>
    <message>
        <source>Try Weblate at &lt;https://demo.weblate.org/&gt;!</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <source>Thank you for using Weblate.</source>
        <translation type="unfinished">Thanks</translation>
    </message>
    <message>
        <source>Obsolete</source>
        <translation type="obsolete">Thanks</translation>
    </message>
</context>
</TS>
```

<!-- AUTOGENERATED START: format-features ts -->
<!-- This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. -->

#### Supported features

| File extensions                                                                                      | `.ts`                          |
|------------------------------------------------------------------------------------------------------|--------------------------------|
| Linguality [ⓘ](https://docs.weblate.org/en/latest/formats.md#bimono)                                   | Both monolingual and bilingual |
| Supports plural [ⓘ](https://docs.weblate.org/en/latest/formats.md#format-plurals)                      | `Yes`                          |
| Supports descriptions [ⓘ](https://docs.weblate.org/en/latest/formats.md#format-description)            | `Yes`                          |
| Supports explanation [ⓘ](https://docs.weblate.org/en/latest/formats.md#format-explanation)             | `No`                           |
| Supports context [ⓘ](https://docs.weblate.org/en/latest/formats.md#format-context)                     | `Yes`                          |
| Supports location [ⓘ](https://docs.weblate.org/en/latest/formats.md#format-location)                   | `Yes`                          |
| Supports flags [ⓘ](https://docs.weblate.org/en/latest/formats.md#format-flags)                         | `Yes`                          |
| Additional states [ⓘ](https://docs.weblate.org/en/latest/formats.md#format-states)                     | `Needs editing`                |
| API identifier                                                                                       | `ts`                           |
| Supports read-only strings [ⓘ](https://docs.weblate.org/en/latest/formats.md#read-only-strings)        | `No`                           |
| Supports removing obsolete strings [ⓘ](https://docs.weblate.org/en/latest/formats.md#obsolete-strings) | `No`                           |
<!-- AUTOGENERATED END: format-features ts -->

## Version 1

The legacy format supports messages, contexts and the unfinished state. It
does not support plurals, locations, descriptions or Weblate flags.

<!-- AUTOGENERATED START: format-features ts1 -->
<!-- This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. -->

#### Supported features

| File extensions                                                                                      | `.ts`                          |
|------------------------------------------------------------------------------------------------------|--------------------------------|
| Linguality [ⓘ](https://docs.weblate.org/en/latest/formats.md#bimono)                                   | Both monolingual and bilingual |
| Supports plural [ⓘ](https://docs.weblate.org/en/latest/formats.md#format-plurals)                      | `No`                           |
| Supports descriptions [ⓘ](https://docs.weblate.org/en/latest/formats.md#format-description)            | `No`                           |
| Supports explanation [ⓘ](https://docs.weblate.org/en/latest/formats.md#format-explanation)             | `No`                           |
| Supports context [ⓘ](https://docs.weblate.org/en/latest/formats.md#format-context)                     | `Yes`                          |
| Supports location [ⓘ](https://docs.weblate.org/en/latest/formats.md#format-location)                   | `No`                           |
| Supports flags [ⓘ](https://docs.weblate.org/en/latest/formats.md#format-flags)                         | `No`                           |
| Additional states [ⓘ](https://docs.weblate.org/en/latest/formats.md#format-states)                     | `Needs editing`                |
| API identifier                                                                                       | `ts1`                          |
| Supports read-only strings [ⓘ](https://docs.weblate.org/en/latest/formats.md#read-only-strings)        | `No`                           |
| Supports removing obsolete strings [ⓘ](https://docs.weblate.org/en/latest/formats.md#obsolete-strings) | `No`                           |
<!-- AUTOGENERATED END: format-features ts1 -->

## Weblate configuration

|                                | Typical Weblate [Component configuration](https://docs.weblate.org/en/latest/admin/projects.md#component) when using as bilingual   |
|--------------------------------|----------------------------------------------------------------------------------------------------------------------------|
| File mask                      | `i18n/app.*.ts`                                                                                                            |
| Monolingual base language file | Empty                                                                                                                      |
| Template for new translations  | `i18n/app.de.ts`                                                                                                           |
| File format                    | Qt Linguist translation file<br/>(version 2)                                                                               |

|                                | Typical Weblate [Component configuration](https://docs.weblate.org/en/latest/admin/projects.md#component) when using as monolingual   |
|--------------------------------|------------------------------------------------------------------------------------------------------------------------------|
| File mask                      | `i18n/app.*.ts`                                                                                                              |
| Monolingual base language file | `i18n/app.en.ts`                                                                                                             |
| Template for new translations  | `i18n/app.en.ts`                                                                                                             |
| File format                    | Qt Linguist translation file<br/>(version 2)                                                                                 |

For version 1 files, use the same configuration and select
Qt Linguist translation file (version 1) as the file format.
