Results 1 to 8 of 8

Thread: Automatic translation in qmake's project?

  1. #1
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Automatic translation in qmake's project?

    Hi, my problem may be unusual:
    I have project that use subdirs project model and lupdate & lrelease doesn't work on it.
    I want make pro files for subprojects in a way that building subprojects would also make translations.
    I already have additional targets translate that does whole work.
    The thing i can't figure out is how to force projects target to be dependent on additional target.
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Automatic translation in qmake's project?

    Can we see the project file?

  3. #3
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Automatic translation in qmake's project?

    I'm at work at the moment and i didn't copied updated pro file from home pc

    its usual project with additional lines like

    update.commands = lupdate hellotr.pro
    updates.depends = $$SOURCES $$HEADERS $$FORMS $$TRANSLATIONS
    release.commands = lrelease hellotr.pro
    release.depends = update
    translate.commands = $(COPY) *.qm ${DESTDIR}
    translate.depends = release
    QMAKE_EXTRA_TARGETS += update release translate

    so make translate updates ts files, releases qms and copies them to destination directory
    I want it to be done when normal make release / make debug is called.

    i found that adding
    POST_TARGETDEPS += translate
    causes it works as i want, but qt documentation says that POST_TARGETDEPS may not work on some backends and looking for another way to do it without POST_TARGETDEPS portability limitations.
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Automatic translation in qmake's project?

    I would suggest using a custom target not related to make release or make debug. It doesn't make much sense to update (and above all to release) the translations during every compilation.

  5. #5
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Automatic translation in qmake's project?

    But if i use 'make translate' on subdirs template, 'translate' target will be passed to subproject's makes?
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Automatic translation in qmake's project?

    If you set the "recursive" option to translate.CONFIG then yes.

  7. The following user says thank you to wysota for this useful post:

    mchara (11th July 2008)

  8. #7
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Automatic translation in qmake's project?

    I've checked it and it works, thanks.

    however i can't find it in any documentation...
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

  9. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Automatic translation in qmake's project?

    Well... it's one of those undocumented things You can learn more by exploring our wiki.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.