<div dir="ltr"><div><div><div><div>Hi Anatoly, <br><br></div>Within Slicer [1], we addressed the creation / updates of the translation files by introducing a variable named Slicer_UPDATE_TRANSLATIONš [2]<br><br></div>Then, within a macro named 'SlicerMacroTranslation.cmake' [3], depending on the value of Slicer_UPDATE_TRANSLATION, we either call <br>

<br>šš (1) QT4_CREATE_TRANSLATION<br><br></div>šš or (2) QT4_ADD_TRANSLATION<br></div><div><br></div>The convenience macro is then called for each executables and libraries we want to translate. See [4] and [5]<br><div><br>

</div><div>These pointers should help you moving forward. <br><br></div><div>The documentation of the Qt macros is available here [6]<br><br>Note also that the translations file are created/updated within the source tree. That way, it is easy to commit them.<br>

</div><div><br></div><div>Hth<br></div><div>Jc<br></div><div><div><div><div><br>[1] <a href="http://wiki.slicer.org/slicerWiki/index.php/Documentation/Labs/I18N">http://wiki.slicer.org/slicerWiki/index.php/Documentation/Labs/I18N</a><br>

<br>[2] <a href="https://github.com/Slicer/Slicer/blob/0dc6eab31c69f859db46a57d3c12ef6a2119f188/CMakeLists.txt#L247">https://github.com/Slicer/Slicer/blob/0dc6eab31c69f859db46a57d3c12ef6a2119f188/CMakeLists.txt#L247</a><br>

<br>[3] <a href="https://github.com/Slicer/Slicer/blob/0dc6eab31c69f859db46a57d3c12ef6a2119f188/CMake/SlicerMacroTranslation.cmake#L21-38">https://github.com/Slicer/Slicer/blob/0dc6eab31c69f859db46a57d3c12ef6a2119f188/CMake/SlicerMacroTranslation.cmake#L21-38</a><br>

<br>[4] <a href="https://github.com/Slicer/Slicer/blob/0dc6eab31c69f859db46a57d3c12ef6a2119f188/Applications/SlicerApp/CMakeLists.txt#L77-98">https://github.com/Slicer/Slicer/blob/0dc6eab31c69f859db46a57d3c12ef6a2119f188/Applications/SlicerApp/CMakeLists.txt#L77-98</a><br>

<br>[5] <a href="https://github.com/Slicer/Slicer/blob/0dc6eab31c69f859db46a57d3c12ef6a2119f188/CMake/SlicerMacroBuildBaseQtLibrary.cmake#L175-193">https://github.com/Slicer/Slicer/blob/0dc6eab31c69f859db46a57d3c12ef6a2119f188/CMake/SlicerMacroBuildBaseQtLibrary.cmake#L175-193</a><br>

<br>[6] <a href="http://www.cmake.org/cmake/help/v2.8.12/cmake.html#module:FindQt4">http://www.cmake.org/cmake/help/v2.8.12/cmake.html#module:FindQt4</a><br></div></div></div></div></div><div class="gmail_extra"><br><br>
<div class="gmail_quote">
On Wed, Feb 26, 2014 at 11:24 PM, Anatoly Shirokov <span dir="ltr"><<a href="mailto:shirokov_a@mail.ru" target="_blank">shirokov_a@mail.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div style="font-family:-moz-fixed;font-size:14px" lang="x-unicode">Please see my comments below
      <br>
      <br>
      27.02.2014 1:08, Stephen Kelly ÐÉÛÅÔ:
      <br><div class="">
      <blockquote type="cite" style>Anatoly Shirokov
        wrote:
        <br>
        <br>
        <blockquote type="cite" style>The translation
          file is usual source file, it is not binary artifact.
          <br>
        </blockquote>
        I didn't say it was a binary artifact. It's a buildsystem
        artifact created
        <br>
        by your buildsystem.
        <br>
      </blockquote></div>
      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.
      <br><div class="">
      <blockquote type="cite" style>
        <blockquote type="cite" style>The only
          difference is that I have to support them in up to date state
          <br>
          with the lupdate utility.
          <br>
        </blockquote>
        Yes.
        <br>
        <br>
        <blockquote type="cite" style>I want to invoke
          lupdate automatically during
          <br>
          build and after that commit updated translation files to use
          them by
          <br>
          translator group.
          <br>
        </blockquote>
        That seems fine.
        <br>
        <br>
        <blockquote type="cite" style>What's wrong
          with such approach?
          <br>
        </blockquote>
        Maybe the details of your approach are too simple. If you commit
        the
        <br>
        translation files resulting from your build to your repo, then
        how did you
        <br>
        lose work?
        <br>
      </blockquote></div>
      1. get sources
      <br>
      2. update sources
      <br>
      3. build to update translation files
      <br>
      4. translate new items extracted during the last build (we can
      translate to several languages ourself)
      <br>
      5. make clean to build whole system (and I lose all translated
      items)
      <br>
      6. commit
      <br>
      ...
      <br>
      N. get sources
      <br>
      N+1. ops, where are my translated items?
      <br>
      <br>
      Actually it was several times.
      <br>
      <br>
      BR,
      <br>
      Anatoly Shirokov
      <br>
      <br>
    </div>
  </div>

<br>--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br><br clear="all"><br>-- <br>+1 919 869 8849<br>
</div>