Qt Linguist: am I doing this right?
I ran lupdate on my program and got a file juliaskein.ts:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0">
<context>
<name>JuliaWidget</name>
<message>
<location filename="jwidget.cpp" line="11"/>
<source>Julia Skein</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
The single string is used as the window title. I then made two copies and edited them in Qt Linguist:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="en_US">
<context>
<name>JuliaWidget</name>
<message>
<location filename="jwidget.cpp" line="11"/>
<source>Julia Skein</source>
<translation>Julia Skein</translation>
</message>
</context>
</TS>
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="es">
<context>
<name>JuliaWidget</name>
<message>
<location filename="jwidget.cpp" line="11"/>
<source>Julia Skein</source>
<translation>Madeja Julia</translation>
</message>
</context>
</TS>
I have both juliaskein_en.ts and juliaskein_es.ts open in Qt Linguist; that's working fine. However, if I open juliaskein.ts, it pops up a dialog box asking what the target language is. This file doesn't have a target language; it should not have any translated strings. What should I do so that it opens without a target language and without asking for a target language? Is there a way to start a new translation in Qt Linguist, or do I just copy a file and edit it?
Re: Qt Linguist: am I doing this right?
So the file juliaskein.ts is your template for creating the actual translations. This approach does not seem very useful to me because next time you want to add a further translation the template might be already outdated. Instead I would just call lupdate to create new translations and of course to update existing ones.
When using CMake you can automate calling lupdate/lrelease by using Qt Linguist macros: http://doc.qt.io/qt-5/cmake-manual.html
It is also possible to automate the process using qmake: https://wiki.qt.io/Automating_generation_of_qm_files
Re: Qt Linguist: am I doing this right?
So, once I've created the first translation, I don't need to keep juliaskein.ts around, and I copy an existing translation to create a new translation? Or do I add it to a list in CMakeLists to create a new translation?