Файлы .ts Qt Linguist

Формат перевода, используемый в приложениях на основе Qt.

Файлы Qt Linguist используются и как двуязычные, так и одноязычные переводы.

Пример файла:

<?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>
Поддерживаемые функции

File extensions

.ts

Linguality

Both monolingual and bilingual

Supports plural

Yes

Supports descriptions

Yes

Supports explanation

No

Supports context

No

Supports location

Yes

Supports flags

Yes

Additional states

Needs editing

API identifier

ts

Supports read-only strings

No

Настройка Weblate

Typical Weblate Настройки компонента when using as bilingual

Маска файла

i18n/app.*.ts

Одноязычный базовый файл

Пусто

Шаблон для новых переводов

i18n/app.de.ts

Формат файла

Файл перевода Qt Linguist

Typical Weblate Настройки компонента when using as monolingual

Маска файла

i18n/app.*.ts

Одноязычный базовый файл

i18n/app.en.ts

Шаблон для новых переводов

i18n/app.en.ts

Формат файла

Файл перевода Qt Linguist