Review Request 117823: Add ecm_install_po_files_as_qm() function

Alex Merry alex.merry at kde.org
Thu May 1 09:58:54 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/117823/#review57049
-----------------------------------------------------------



modules/ECMCreateQmFromPoFiles.cmake
<https://git.reviewboard.kde.org/r/117823/#comment39739>

    Can you add in a note about how it will be removed before ECM 1.0?



modules/ECMPoQmTools.cmake
<https://git.reviewboard.kde.org/r/117823/#comment39740>

    I'd just start with "Searches for" - it's already obvious what function you're talking about.



modules/ECMPoQmTools.cmake
<https://git.reviewboard.kde.org/r/117823/#comment39741>

    Double-backticks around the function call.



modules/ECMPoQmTools.cmake
<https://git.reviewboard.kde.org/r/117823/#comment39748>

    I wonder if it would be better to actually just have this as an extra argument. I mean, it's easy enough to make the frameworks use
    ecm_install_po_files_as_qm(po ${LOCALE_INSTALL_DIR})
    or
    ecm_install_po_files_as_qm(PODIR po DESTINATION ${LOCALE_INSTALL_DIR})
    or something like that.



modules/ECMPoQmTools.cmake
<https://git.reviewboard.kde.org/r/117823/#comment39743>

    See the other modules for the style of "multiple arguments" to use:
    <pofile> [<pofile> [...]]
    (for consistency with the rest of the documentation)



modules/ECMPoQmTools.cmake
<https://git.reviewboard.kde.org/r/117823/#comment39742>

    Huh? Isn't <lang> just the first argument? In which case, there's no need to explain <install_destination> and <lang> - they're in the signature above.



modules/ECMPoQmTools.cmake
<https://git.reviewboard.kde.org/r/117823/#comment39746>

    That's not what the code does - if INSTALL_DESTINATION isn't given, they aren't installed.



modules/ECMPoQmTools.cmake
<https://git.reviewboard.kde.org/r/117823/#comment39747>

    The target is called "translations"



modules/ECMPoQmTools.cmake
<https://git.reviewboard.kde.org/r/117823/#comment39744>

    Should probably include KitWare's copyright line, then.



modules/ECMPoQmTools.cmake
<https://git.reviewboard.kde.org/r/117823/#comment39745>

    I don't see any call to lupdate


I would consider your tests minimal - they don't really test the whole functionality of the module (like not having optional arguments or the various different installation dir variables you can set for ecm_install_po_files_as_qm). Also, you don't need to test the functionality of QTranslator itself too much - I would trim down the pofiles to the bare minimum (even just one message).

- Alex Merry


On April 30, 2014, 4:48 p.m., Aurélien Gâteau wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117823/
> -----------------------------------------------------------
> 
> (Updated April 30, 2014, 4:48 p.m.)
> 
> 
> Review request for Build System, Extra Cmake Modules and KDE Frameworks.
> 
> 
> Repository: extra-cmake-modules
> 
> 
> Description
> -------
> 
> This patch adds a ecm_install_po_files_as_qm() function to ECMCreateQmFromPoFiles.cmake. This function makes it easy to install all the .po files of a Qt-translated framework.
> 
> The primary user of this function is the build system of the framework tarballs. The tarballs will ship with a po/ directory which follows the structure expected by ecm_install_po_files_as_qm(). The only necessary change is to add the following lines to the root CMakeLists.txt file:
> 
>     if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
>         ecm_install_po_files_as_qm(po)
>     endif()
> 
> Since the code checks for the presence of a po/ directory, it can be committed in the framework repository (no need for the tarball release scripts to alter the CMake files), making it easier for developers to reproduce the situation of a released tarball by creating/copying a po/ directory in their working copy.
> 
> We need this function (or something similar) because the way we are going to organize po files in the framework tarballs have changed: the current CMake code expects the po files to contain files named '<domain>-<lang>.po', but the final structure is going to be '<lang>/<domain>.po'.
> 
> This new function works similarly to ki18n_install() ( https://git.reviewboard.kde.org/r/117804/ ) and kdoctools_install() ( https://git.reviewboard.kde.org/r/117805/ )
> 
> 
> Diffs
> -----
> 
>   modules/ECMCreateQmFromPoFiles.cmake 7457fc5 
>   modules/ECMPoQmTools.cmake PRE-CREATION 
>   modules/ECMQmLoader.cpp.in 2d8531f 
>   tests/CMakeLists.txt 171f44a 
>   tests/ECMPoQmToolsTest/CMakeLists.txt PRE-CREATION 
>   tests/ECMPoQmToolsTest/check_tree.cmake.in PRE-CREATION 
>   tests/ECMPoQmToolsTest/po/es/install-test.po PRE-CREATION 
>   tests/ECMPoQmToolsTest/po/fr/install-test.po PRE-CREATION 
>   tests/ECMPoQmToolsTest/test.po PRE-CREATION 
> 
> Diff: https://git.reviewboard.kde.org/r/117823/diff/
> 
> 
> Testing
> -------
> 
> Modified kbookmarks to call ecm_install_po_files_as_qm(). Works as expected.
> 
> 
> Thanks,
> 
> Aurélien Gâteau
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-buildsystem/attachments/20140501/0be76fab/attachment-0001.html>


More information about the Kde-buildsystem mailing list