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
1=== modified file '.bzrignore'
2--- .bzrignore 2012-08-02 11:54:15 +0000
3+++ .bzrignore 2017-02-07 19:24:33 +0000
4@@ -1,2 +1,5 @@
5-compile
6+build/
7+po/Makefile.in.in
8+po/POTFILES.in
9+
10 indicator-location
11
12=== removed directory 'cmake'
13=== removed file 'cmake/Translations.cmake'
14--- cmake/Translations.cmake 2014-08-09 23:21:43 +0000
15+++ cmake/Translations.cmake 1970-01-01 00:00:00 +0000
16@@ -1,37 +0,0 @@
17-# Translations.cmake, CMake macros written for Marlin, feel free to re-use them
18-
19-macro(add_translations_directory NLS_PACKAGE)
20- add_custom_target (i18n ALL)
21- find_program (MSGFMT_EXECUTABLE msgfmt)
22- file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po)
23- foreach (PO_INPUT ${PO_FILES})
24- get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME_WE)
25- set (MO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PO_INPUT_BASE}.mo)
26- add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} -o ${MO_OUTPUT} ${PO_INPUT})
27-
28- install (FILES ${MO_OUTPUT} DESTINATION
29- ${CMAKE_INSTALL_LOCALEDIR}/${PO_INPUT_BASE}/LC_MESSAGES
30- RENAME ${NLS_PACKAGE}.mo)
31- endforeach (PO_INPUT ${PO_FILES})
32-endmacro(add_translations_directory)
33-
34-
35-macro(add_translations_catalog NLS_PACKAGE)
36- add_custom_target (pot COMMENT “Building translation catalog.”)
37- find_program (XGETTEXT_EXECUTABLE xgettext)
38-
39- # init this list, which will hold all the sources across all dirs
40- set(SOURCES "")
41-
42- # add each directory's sources to the overall sources list
43- foreach(FILES_INPUT ${ARGN})
44- set (DIR ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT})
45- file (GLOB_RECURSE DIR_SOURCES ${DIR}/*.c ${DIR}/*.cc ${DIR}/*.cpp ${DIR}/*.cxx ${DIR}/*.vala)
46- set (SOURCES ${SOURCES} ${DIR_SOURCES})
47- endforeach()
48-
49- add_custom_command (TARGET pot COMMAND
50- ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot
51- ${SOURCES} --keyword="_" --keyword="N_" --from-code=UTF-8
52- )
53-endmacro()
54
55=== modified file 'po/CMakeLists.txt'
56--- po/CMakeLists.txt 2013-08-26 20:38:29 +0000
57+++ po/CMakeLists.txt 2017-02-07 19:24:33 +0000
58@@ -1,3 +1,12 @@
59-include (Translations)
60-add_translations_directory ("${GETTEXT_PACKAGE}")
61-add_translations_catalog ("${GETTEXT_PACKAGE}" ../src/)
62+find_package(Intltool REQUIRED)
63+
64+intltool_update_potfile(
65+ KEYWORDS "_" "_:1,2" "N_" "N_:1,2"
66+ GETTEXT_PACKAGE ${GETTEXT_PACKAGE}
67+ COPYRIGHT_HOLDER "Canonical Ltd."
68+)
69+
70+intltool_install_translations(
71+ ALL
72+ GETTEXT_PACKAGE ${GETTEXT_PACKAGE}
73+)
74
75=== removed file 'po/POTFILES.in'
76--- po/POTFILES.in 2013-08-26 20:19:46 +0000
77+++ po/POTFILES.in 1970-01-01 00:00:00 +0000
78@@ -1,1 +0,0 @@
79-src/phone.cc
80
81=== removed file 'po/update-pot.sh'
82--- po/update-pot.sh 2014-05-27 08:45:15 +0000
83+++ po/update-pot.sh 1970-01-01 00:00:00 +0000
84@@ -1,28 +0,0 @@
85-#!/bin/sh
86-set -e
87-cd $(dirname $0)
88-PO_DIR=$PWD
89-
90-PKGNAME="indicator-location"
91-PROGNAME=$(basename $0)
92-
93-# Create a list of files to scan
94-GETTEXT_FILES=$(mktemp --tmpdir uitk-unity.lst.XXXXX)
95-trap 'rm -f "$GETTEXT_FILES"' EXIT
96-cd ..
97-find \( -name '*.h' -o -name '*.cpp' -o -name '*.cc' -o -name '*.c' -o -name '*.qml' -o -name '*.js' \) \
98- -a ! \( -path './debian/*' -o -path './builddir/*' -o -path './build/*' -o -path './.bzr/*' \) | sort \
99-> $GETTEXT_FILES
100-cat $GETTEXT_FILES
101-
102-# Generate pot from our list
103-xgettext \
104- --output $PO_DIR/$PKGNAME.pot \
105- --files-from $GETTEXT_FILES \
106- --c++ \
107- --add-comments=TRANSLATORS \
108- --keyword=_ \
109- --package-name="$PKGNAME" \
110- --copyright-holder="Canonical Ltd."
111-
112-echo "$PROGNAME: $PO_DIR/$PKGNAME.pot updated"

Subscribers

People subscribed via source and target branches