Merge lp:~dobey/indicator-location/fix-i18n into lp:indicator-location

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 165
Merged at revision: 165
Proposed branch: lp:~dobey/indicator-location/fix-i18n
Merge into: lp:indicator-location
Prerequisite: lp:~dobey/indicator-location/fix-coverage
Diff against target: 112 lines (+16/-70)
5 files modified
.bzrignore (+4/-1)
cmake/Translations.cmake (+0/-37)
po/CMakeLists.txt (+12/-3)
po/POTFILES.in (+0/-1)
po/update-pot.sh (+0/-28)
To merge this branch: bzr merge lp:~dobey/indicator-location/fix-i18n
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
unity-api-1-bot continuous-integration Approve
Ted Gould (community) Approve
Review via email: mp+316607@code.launchpad.net

Commit message

Use intltool module from cmake-extras.

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) :
review: Approve
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:165
https://jenkins.canonical.com/unity-api-1/job/lp-indicator-location-ci/6/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/1620
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/1627
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1405
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1405/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1405
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1405/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1405
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1405/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1405
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1405/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1405
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1405/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1405
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1405/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-indicator-location-ci/6/rebuild

review: Approve (continuous-integration)
Revision history for this message
Charles Kerr (charlesk) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2012-08-02 11:54:15 +0000
+++ .bzrignore 2017-02-07 19:24:33 +0000
@@ -1,2 +1,5 @@
1compile1build/
2po/Makefile.in.in
3po/POTFILES.in
4
2indicator-location5indicator-location
36
=== removed directory 'cmake'
=== removed file 'cmake/Translations.cmake'
--- cmake/Translations.cmake 2014-08-09 23:21:43 +0000
+++ cmake/Translations.cmake 1970-01-01 00:00:00 +0000
@@ -1,37 +0,0 @@
1# Translations.cmake, CMake macros written for Marlin, feel free to re-use them
2
3macro(add_translations_directory NLS_PACKAGE)
4 add_custom_target (i18n ALL)
5 find_program (MSGFMT_EXECUTABLE msgfmt)
6 file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po)
7 foreach (PO_INPUT ${PO_FILES})
8 get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME_WE)
9 set (MO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PO_INPUT_BASE}.mo)
10 add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} -o ${MO_OUTPUT} ${PO_INPUT})
11
12 install (FILES ${MO_OUTPUT} DESTINATION
13 ${CMAKE_INSTALL_LOCALEDIR}/${PO_INPUT_BASE}/LC_MESSAGES
14 RENAME ${NLS_PACKAGE}.mo)
15 endforeach (PO_INPUT ${PO_FILES})
16endmacro(add_translations_directory)
17
18
19macro(add_translations_catalog NLS_PACKAGE)
20 add_custom_target (pot COMMENT “Building translation catalog.”)
21 find_program (XGETTEXT_EXECUTABLE xgettext)
22
23 # init this list, which will hold all the sources across all dirs
24 set(SOURCES "")
25
26 # add each directory's sources to the overall sources list
27 foreach(FILES_INPUT ${ARGN})
28 set (DIR ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT})
29 file (GLOB_RECURSE DIR_SOURCES ${DIR}/*.c ${DIR}/*.cc ${DIR}/*.cpp ${DIR}/*.cxx ${DIR}/*.vala)
30 set (SOURCES ${SOURCES} ${DIR_SOURCES})
31 endforeach()
32
33 add_custom_command (TARGET pot COMMAND
34 ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot
35 ${SOURCES} --keyword="_" --keyword="N_" --from-code=UTF-8
36 )
37endmacro()
380
=== modified file 'po/CMakeLists.txt'
--- po/CMakeLists.txt 2013-08-26 20:38:29 +0000
+++ po/CMakeLists.txt 2017-02-07 19:24:33 +0000
@@ -1,3 +1,12 @@
1include (Translations)1find_package(Intltool REQUIRED)
2add_translations_directory ("${GETTEXT_PACKAGE}")2
3add_translations_catalog ("${GETTEXT_PACKAGE}" ../src/)3intltool_update_potfile(
4 KEYWORDS "_" "_:1,2" "N_" "N_:1,2"
5 GETTEXT_PACKAGE ${GETTEXT_PACKAGE}
6 COPYRIGHT_HOLDER "Canonical Ltd."
7)
8
9intltool_install_translations(
10 ALL
11 GETTEXT_PACKAGE ${GETTEXT_PACKAGE}
12)
413
=== removed file 'po/POTFILES.in'
--- po/POTFILES.in 2013-08-26 20:19:46 +0000
+++ po/POTFILES.in 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1src/phone.cc
20
=== removed file 'po/update-pot.sh'
--- po/update-pot.sh 2014-05-27 08:45:15 +0000
+++ po/update-pot.sh 1970-01-01 00:00:00 +0000
@@ -1,28 +0,0 @@
1#!/bin/sh
2set -e
3cd $(dirname $0)
4PO_DIR=$PWD
5
6PKGNAME="indicator-location"
7PROGNAME=$(basename $0)
8
9# Create a list of files to scan
10GETTEXT_FILES=$(mktemp --tmpdir uitk-unity.lst.XXXXX)
11trap 'rm -f "$GETTEXT_FILES"' EXIT
12cd ..
13find \( -name '*.h' -o -name '*.cpp' -o -name '*.cc' -o -name '*.c' -o -name '*.qml' -o -name '*.js' \) \
14 -a ! \( -path './debian/*' -o -path './builddir/*' -o -path './build/*' -o -path './.bzr/*' \) | sort \
15> $GETTEXT_FILES
16cat $GETTEXT_FILES
17
18# Generate pot from our list
19xgettext \
20 --output $PO_DIR/$PKGNAME.pot \
21 --files-from $GETTEXT_FILES \
22 --c++ \
23 --add-comments=TRANSLATORS \
24 --keyword=_ \
25 --package-name="$PKGNAME" \
26 --copyright-holder="Canonical Ltd."
27
28echo "$PROGNAME: $PO_DIR/$PKGNAME.pot updated"

Subscribers

People subscribed via source and target branches