Dear Jean-Christophe Fillion-Robin!

Thank you very much for your attention. But I do not have a problem with CREATE. I have problem with UPDATE, actually with QTx_CREATE_TRANSLATION. QTx_CREATE_TRANSLATION uses add_custom_command which forces to delete the original updated SOURCE ts file during clean:

- get sources
- change sources
- build (build calls lupdate to update ts files)
- add translation to existing ts files
- "make clean" deletes all ts files with your translations

Have you understood the core of problem?

Here https://bugreports.qt-project.org/browse/QTBUG-31860 and here http://cmake.3232098.n2.nabble.com/How-to-not-delete-generated-files-on-make-clean-td4425991.html you can find details.

Thank you for your time!

BR,
Anatoly Shirokov.

27.02.2014 9:01, Jean-Christophe Fillion-Robin пишет:
Hi Anatoly,

Within Slicer [1], we addressed the creation / updates of the translation files by introducing a variable named Slicer_UPDATE_TRANSLATION [2]

Then, within a macro named 'SlicerMacroTranslation.cmake' [3], depending on the value of Slicer_UPDATE_TRANSLATION, we either call

   (1) QT4_CREATE_TRANSLATION

   or (2) QT4_ADD_TRANSLATION

The convenience macro is then called for each executables and libraries we want to translate. See [4] and [5]

These pointers should help you moving forward.

The documentation of the Qt macros is available here [6]

Note also that the translations file are created/updated within the source tree. That way, it is easy to commit them.

Hth
Jc

[1] http://wiki.slicer.org/slicerWiki/index.php/Documentation/Labs/I18N

[2] https://github.com/Slicer/Slicer/blob/0dc6eab31c69f859db46a57d3c12ef6a2119f188/CMakeLists.txt#L247

[3] https://github.com/Slicer/Slicer/blob/0dc6eab31c69f859db46a57d3c12ef6a2119f188/CMake/SlicerMacroTranslation.cmake#L21-38

[4] https://github.com/Slicer/Slicer/blob/0dc6eab31c69f859db46a57d3c12ef6a2119f188/Applications/SlicerApp/CMakeLists.txt#L77-98

[5] https://github.com/Slicer/Slicer/blob/0dc6eab31c69f859db46a57d3c12ef6a2119f188/CMake/SlicerMacroBuildBaseQtLibrary.cmake#L175-193

[6] http://www.cmake.org/cmake/help/v2.8.12/cmake.html#module:FindQt4


On Wed, Feb 26, 2014 at 11:24 PM, Anatoly Shirokov <shiroko...@mail.ru <mailto:shiroko...@mail.ru>> wrote:

    Please see my comments below

    27.02.2014 1:08, Stephen Kelly пишет:
    Anatoly Shirokov wrote:

    The translation file is usual source file, it is not binary
    artifact.
    I didn't say it was a binary artifact. It's a buildsystem
    artifact created
    by your buildsystem.
    This is source which can be updated by build system. But initially
    this is source file was made by myself for each supported
    languages and put it to repository.
    The only difference is that I have to support them in up to date
    state
    with the lupdate utility.
    Yes.

    I want to invoke lupdate automatically during
    build and after that commit updated translation files to use
    them by
    translator group.
    That seems fine.

    What's wrong with such approach?
    Maybe the details of your approach are too simple. If you commit the
    translation files resulting from your build to your repo, then
    how did you
    lose work?
    1. get sources
    2. update sources
    3. build to update translation files
    4. translate new items extracted during the last build (we can
    translate to several languages ourself)
    5. make clean to build whole system (and I lose all translated items)
    6. commit
    ...
    N. get sources
    N+1. ops, where are my translated items?

    Actually it was several times.

    BR,
    Anatoly Shirokov


    --

    Powered by www.kitware.com <http://www.kitware.com>

    Please keep messages on-topic and check the CMake FAQ at:
    http://www.cmake.org/Wiki/CMake_FAQ

    Kitware offers various services to support the CMake community.
    For more information on each offering, please visit:

    CMake Support: http://cmake.org/cmake/help/support.html
    CMake Consulting: http://cmake.org/cmake/help/consulting.html
    CMake Training Courses: http://cmake.org/cmake/help/training.html

    Visit other Kitware open-source projects at
    http://www.kitware.com/opensource/opensource.html

    Follow this link to subscribe/unsubscribe:
    http://www.cmake.org/mailman/listinfo/cmake




--
+1 919 869 8849

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to