Review Request 117560: ECMCreateQmFromPoFiles: adjust API to make it usable from within trunk/l10n-kf5

Alex Merry alex.merry at kde.org
Tue Apr 15 13:54:54 UTC 2014


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


The main thing that concerns me is the lack of source compatibility, given that the original version was included in beta1.  Can you make it so that the old way of calling it will still work, even if the behaviour isn't exactly the same?

Also, and sorry about this, e-c-m now uses reST-based documentation.  Can you please rework the docs (and copyright/license notice) to match the style/syntax of the other modules?


modules/ECMCreateQmFromPoFiles.cmake
<https://git.reviewboard.kde.org/r/117560/#comment38864>

    Some info about where mylib.qm will be looked for would be useful.


- Alex Merry


On April 14, 2014, 1:18 p.m., Aurélien Gâteau wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117560/
> -----------------------------------------------------------
> 
> (Updated April 14, 2014, 1:18 p.m.)
> 
> 
> Review request for Build System, Extra Cmake Modules and KDE Frameworks.
> 
> 
> Repository: extra-cmake-modules
> 
> 
> Description
> -------
> 
> Translators (are going to) translate KF5 in trunk/l10n-kf5 ( http://websvn.kde.org/trunk/l10n-kf5/ ). It is necessary to support their work-flow, which consists of:
> 1) build the code from git
> 2) builds and installs all translations from one language
> 
> The patch makes several changes to ECMCreateQmFromPoFiles to support this work-flow:
> 
> - It splits the code into two functions: one to create the .qm and install them, another to build the .qm loader. This way the loader can be generated even if no translations are available.
> 
> - It changes the syntax of ecm_create_qm_from_po_files() to accept po files instead of a po directory. This is needed because within the same language directory some .po are going to be turned into .qm while others are turned into .mo.
> 
> - It creates "translation-N" targets (like CMake gettext code does) to support multiple calls within one cmake project.
> 
> - It installs to share/locale/<lang>/LC_MESSAGES (like gettext), because l10n-kf5 build system cannot know where the framework would decide to keep its .qm file, so it's simpler to use a standard place.
> 
> This potentially breaks existing framework builds, but only for developers who created manually po/ directories in their work tree (almost nobody, I expect), so I think it can be pushed as is. I already have the code ready to fix existing frameworks.
> 
> Those changes still support shipping translations within frameworks tarballs. Assuming this patch gets in, the build system of each framework is going to be patched like this:
> 
> -----------------------------------------------------
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index b5e445c..c9a706c 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -16,6 +16,8 @@ include(GenerateExportHeader)
>  include(ECMSetupVersion)
>  include(ECMGenerateHeaders)
>  
> +include(ECMCreateQmFromPoFiles)
> +
>  set(KF5_VERSION "4.98.0")
>  
>  ecm_setup_version(${KF5_VERSION}
> @@ -37,14 +39,9 @@ if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
>    find_package(KF5XmlGui ${KF5_VERSION} REQUIRED)
>  endif()
>  
> -if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/po)
> -  include(ECMCreateQmFromPoFiles)
> -  ecm_create_qm_from_po_files(
> -    PO_DIR po
> -    POT_NAME kbookmarks5.pot
> -    DATA_INSTALL_SUB_DIR kbookmarks
> -    CREATE_LOADER kbookmarks_QM_LOADER
> -  )
> +file(GLOB PO_FILES "po/*.po")
> +if (PO_FILES)
> +  ecm_create_qm_from_po_files(PO_FILES ${PO_FILES} CATALOG_NAME kbookmarks5)
>  endif()
>  
>  add_subdirectory(src)
> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
> index 676b172..faa25e1 100644
> --- a/src/CMakeLists.txt
> +++ b/src/CMakeLists.txt
> @@ -1,6 +1,8 @@
>  # TODO
>  remove_definitions(-DQT_NO_CAST_FROM_ASCII)
>  
> +ecm_create_qm_loader(kbookmarks_QM_LOADER kbookmarks5)
> +
>  set(kbookmarks_SRCS
>    kbookmark.cpp
>    kbookmarkaction.cpp
> -----------------------------------------------------
> 
> 
> Diffs
> -----
> 
>   modules/ECMCreateQmFromPoFiles.cmake f24090b 
>   modules/ECMQmLoader.cpp.in 4fd9c11 
> 
> Diff: https://git.reviewboard.kde.org/r/117560/diff/
> 
> 
> Testing
> -------
> 
> Built translations for KF5 from within frameworks source and from a patched l10n-kf5.
> 
> 
> Thanks,
> 
> Aurélien Gâteau
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140415/0c403744/attachment.html>


More information about the Kde-frameworks-devel mailing list