Qt World Summit: Register Today!

Template "subdirs" and translations

  • Hello,

    I have splitted a larger project with the template "subdirs" into several projects. Now, i want to translate the complete application with generating one big translation file. Is this possible?

  • I've found a more or less practicable solution:

    First, add the translations you want to have in the related .pri or .pro file:

    @NAME = "dialog"
    TRANSLATIONS += $$PWD/../$$NAME/de.ts

    Then, i've created a new directory called translations in the base directory.
    Finally i've wrote a cmd line script (for windows) with this content:

    @lupdate dialog\dialog.pri
    lupdate main\main.pri
    lupdate -recursive dialog main -source-language de_DE -target-language de_DE -ts translations\de_DE.ts
    lupdate -recursive dialog main -source-language de_DE -target-language en_US -ts translations\en_EN.ts
    del dialog*.ts
    del main*.ts@

    This Script first calls lupdate for every subproject (line 1-2).
    Than, call a recursive lupdate scan for every language you want to have (line 3-4)
    In the last lines delete the ts files in the subdirs... they are now unneeded.
    You can safely call this script, the files in the translation dir are upated.

    Hope that will help....

  • Someone could confirm that it's not possible to use lupdate on a TEMPLATE = subdirs?
    I am facing the same problem and would like to avoid the batch solution

Log in to reply