The Problem
Using native Qt translation files (TS, *.ts) for exchanging with Transifex platform limits means to provide context
to translators to the only category:
| C++ source code | TS XML element | Transifex metadata
|-----------------------------------------------|------------------------------------------------|:------------------:
| Class Name | <name>ClassName</name> | Context
| disambiguation parameter of tr() function | <comment>Short comment</comment> | N/A
| Translator Comments //: ... | <extracomment>Nice comment.</extracomment> | N/A
More details:
- https://docs.transifex.com/formats/introduction
- https://docs.transifex.com/formats/qt-ts
- https://doc.qt.io/qt-5/linguist-ts-file-format.html
The Solution
XLIFF file format is supported by Transifex much better.
And Qt provides us with a stand-alone conversion tool lconvert.
$ lconvert -o bitcoin_es.xlf -i bitcoin_en.ts
Now more context options are available:
| TS XML element | XLIFF XML element | Transifex metadata
|------------------------------------------------|-------------------------------------------------|:------------------:
| <name>ClassName</name> | <group resname="ClassName">...</group> | yes
| <comment>Short comment</comment> | <context>Short comment</context> | yes
| <extracomment>Nice comment.</extracomment> | <note from="developer">Nice comment.</note> | yes
More details:
- https://docs.transifex.com/formats/xliff
- https://code.qt.io/cgit/qt/qttools.git/tree/src/linguist/lconvert/lconvert.pro?h=5.12.10
Looking for Concept (N)ACKs.