I'm looking for a way to cheat and create some very rough translations of my Qt application using Qt linguist and an already-existing translation service such as google translate.
There's a public API for google translate, so I'm hoping someone has already tried this, but I can't seem to find it. Has anyone seen anything like this before?
I'm not expecting brilliant translations - at this point it's just to show as a proof of concept.
Qt provides excellent support for translating Qt C++ and Qt Quick applications into local languages. Release managers, translators, and developers can use Qt tools to accomplish their tasks. Release managers bear the overall responsibility for the release of the application.
Run Qt Linguist from the taskbar menu, or by double clicking the desktop icon, or by entering the command linguist at the command line. Once Qt Linguist has started, choose File|Open from the menu bar and select a translation source (TS file) to load.
The Qt tools provide context information for each of the phrases to help the translator, and the developer is able to add additional context information to phrases when necessary. The release manager generates a set of translation files that are produced from the source files and passes these to the translator.
I've written an open source app to do this with gettext .po files, it wouldn't be hard to modify for Qt Linguist files. Demo and php source available at http://pepipopum.dixo.net
You could use lconvert to convert the files to .po
lconvert -if ts -of po -o myFile.po myfile.ts
Then run them through Paul Dixons translator, then convert them back using lconvert
again.
lconvert -if po -of ts -o myFile.ts myfile.po
I haven't seen anything like this before (probably because automated translation will likely produce less than stellar results), but it shouldn't be too hard to implement.
The .ts files produced by the lupdate
tool are in fact plain XML files (and even not so complicated ones - just open one in a text editor and see for your self). Therefore, you can use a variety of XML tools/libraries to edit the <translation>
elements in the file. Qt even comes with one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With