[Merge] lp:~phablet-team/camera-app/camera-app-desktop-translation into lp:camera-app
David Planella
david.planella at ubuntu.com
Wed Aug 13 12:00:44 UTC 2014
Review: Needs Fixing
Looks good to me, just a couple of things:
- In the core apps, we've added an additional COMMAND ${CMAKE_COMMAND} -E copy ${POT_FILE} ${CMAKE_CURRENT_SOURCE_DIR} command to get the .pot file copied to and updated in the source dir, so that it does not need to be manually copied. See [1]
- In the top CMakeLists.txt file, in core apps we made it 'RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po' instead of 'RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}', as by convention the source code paths in the .pot file are relative to the .po folder.
- Other comments inline
[1] https://code.launchpad.net/~dpm/ubuntu-filemanager-app/desktop-i18n/+merge/230591
Diff comments:
> === modified file 'CMakeLists.txt'
> --- CMakeLists.txt 2014-07-31 18:41:17 +0000
> +++ CMakeLists.txt 2014-08-13 11:39:04 +0000
> @@ -13,6 +13,9 @@
> find_package(Qt5Multimedia)
> find_package(Qt5Gui)
>
> +find_program(INTLTOOL_MERGE intltool-merge)
> +find_program(INTLTOOL_EXTRACT intltool-extract)
> +
> # Standard install paths
> include(GNUInstallDirs)
>
> @@ -21,6 +24,7 @@
>
> set(CAMERA_APP camera-app)
> set(AUTOPILOT_DIR camera_app)
> +set(DESKTOP_FILE camera-app.desktop)
>
> if(CLICK_MODE)
> if(NOT DEFINED BZR_SOURCE)
> @@ -97,14 +101,11 @@
> DESTINATION ${CAMERA_APP_DIR}
> )
>
> -set(DESKTOP_FILE camera-app.desktop)
> -file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE})
> -file(STRINGS ${DESKTOP_FILE}.in DESKTOP_FILE_CONTENTS)
> -foreach(LINE ${DESKTOP_FILE_CONTENTS})
> - string(REGEX REPLACE "tr\\\(\"(.*)\"\\\)" "\\1" LINE "${LINE}")
> - string(CONFIGURE "${LINE}" LINE)
> - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE} "${LINE}\n")
> -endforeach(LINE)
> +configure_file(${DESKTOP_FILE}.in.in ${DESKTOP_FILE}.in)
> +add_custom_target(${DESKTOP_FILE} ALL
> + COMMENT "Merging translations into ${DESKTOP_FILE}"
> + COMMAND LC_ALL=C ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po ${DESKTOP_FILE}.in ${DESKTOP_FILE} >/dev/null
> + )
>
> # make non compiled files visible in qtcreator
> file(GLOB_RECURSE NON_COMPILED_FILES *.qml *.js *.py *.svg *.png *.in *.json *.desktop *.pot qmldir)
> @@ -133,7 +134,8 @@
>
> file(GLOB_RECURSE I18N_SRC_FILES
> RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
> - **.qml **.desktop.in)
> + **.qml)
> +list(APPEND I18N_SRC_FILES ${DESKTOP_FILE}.in.in)
The file's extension should be .in.in.h
> list(SORT I18N_SRC_FILES)
>
> # for dh_translations to extract the domain
>
> === renamed file 'camera-app.desktop.in' => 'camera-app.desktop.in.in'
> --- camera-app.desktop.in 2014-02-14 18:09:17 +0000
> +++ camera-app.desktop.in.in 2014-08-13 11:39:04 +0000
> @@ -1,11 +1,11 @@
> [Desktop Entry]
> Type=Application
> -Name=tr("Camera")
> -GenericName=camera-app
> -Comment=tr("Camera application")
> +_Name=Camera
> +_Comment=Camera application
> +_GenericName=Camera
> +_Keywords=Photos;Videos;Capture;Shoot;Snapshot;Record
> Exec=@DESKTOP_EXEC@ %u
> Terminal=false
> Icon=@CAMERA_ICON@
> X-Ubuntu-Touch=true
> -X-Ubuntu-Gettext-Domain=camera-app
> X-Ubuntu-Single-Instance=true
>
> === modified file 'po/CMakeLists.txt'
> --- po/CMakeLists.txt 2013-06-11 16:05:35 +0000
> +++ po/CMakeLists.txt 2014-08-13 11:39:04 +0000
> @@ -7,7 +7,10 @@
> set(POT_FILE ${DOMAIN}.pot)
> file(GLOB PO_FILES *.po)
>
> -add_custom_target(${POT_FILE}
> +add_custom_target(${POT_FILE} ALL
> + COMMENT "Generating translation template"
> + COMMAND ${INTLTOOL_EXTRACT} --update --type=gettext/ini
> + --srcdir=${CMAKE_SOURCE_DIR} ${DESKTOP_FILE}.in.in
> COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE}
> -D ${CMAKE_SOURCE_DIR}
This might need both:
-D ${CMAKE_CURRENT_SOURCE_DIR}
-D ${CMAKE_CURRENT_BINARY_DIR}
> --from-code=UTF-8
> @@ -25,3 +28,4 @@
> DESTINATION ${INSTALL_DIR}
> RENAME ${DOMAIN}.mo)
> endforeach(PO_FILE)
> +
>
> === modified file 'po/camera-app.pot'
> --- po/camera-app.pot 2014-06-30 07:40:05 +0000
> +++ po/camera-app.pot 2014-08-13 11:39:04 +0000
> @@ -1,6 +1,6 @@
> -# Ubuntu camera app translation.
> -# Copyright 2014 Canonical Ltd.
> -# This file is distributed under the same license as the camera-app package.
> +# SOME DESCRIPTIVE TITLE.
> +# Copyright (C) YEAR Canonical Ltd.
> +# This file is distributed under the same license as the PACKAGE package.
> # FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
> #
> #, fuzzy
>
--
https://code.launchpad.net/~phablet-team/camera-app/camera-app-desktop-translation/+merge/223229
Your team Ubuntu Phablet Team is requested to review the proposed merge of lp:~phablet-team/camera-app/camera-app-desktop-translation into lp:camera-app.
More information about the Ubuntu-reviews
mailing list