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

Proposed by dobey on 2017-02-07
Status: Merged
Approved by: dobey on 2017-02-10
Approved revision: 307
Merged at revision: 307
Proposed branch: lp:~dobey/indicator-power/fix-i18n
Merge into: lp:indicator-power
Prerequisite: lp:~dobey/indicator-power/fix-coverage
Diff against target: 327 lines (+236/-48)
6 files modified
.bzrignore (+4/-0)
cmake/Translations.cmake (+0/-37)
debian/control (+3/-4)
po/CMakeLists.txt (+12/-3)
po/POTFILES.in (+0/-4)
po/indicator-power.pot (+217/-0)
To merge this branch: bzr merge lp:~dobey/indicator-power/fix-i18n
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve on 2017-02-10
Pete Woods (community) 2017-02-07 Approve on 2017-02-10
unity-api-1-bot continuous-integration Approve on 2017-02-07
Review via email: mp+316624@code.launchpad.net

Commit message

Use intltool support from cmake-extras.

To post a comment you must log in.
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:307
https://jenkins.canonical.com/unity-api-1/job/lp-indicator-power-ci/9/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/1625
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/1632
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1410
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1410/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1410
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/1410/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1410
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1410/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1410
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/1410/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1410
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/1410/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1410
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/1410/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Pete Woods (pete-woods) :
review: Approve
Charles Kerr (charlesk) wrote :

I still have the reservations that we discussed in IRC, but it's not a dealbreaker. I'm more interested in us handling things in a consistent way across repos and these branches improve that story

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.bzrignore'
2--- .bzrignore 1970-01-01 00:00:00 +0000
3+++ .bzrignore 2017-02-07 20:22:02 +0000
4@@ -0,0 +1,4 @@
5+build/
6+po/Makefile.in.in
7+po/POTFILES.in
8+
9
10=== removed file 'cmake/Translations.cmake'
11--- cmake/Translations.cmake 2014-08-09 23:19:02 +0000
12+++ cmake/Translations.cmake 1970-01-01 00:00:00 +0000
13@@ -1,37 +0,0 @@
14-# Translations.cmake, CMake macros written for Marlin, feel free to re-use them
15-
16-macro(add_translations_directory NLS_PACKAGE)
17- add_custom_target (i18n ALL)
18- find_program (MSGFMT_EXECUTABLE msgfmt)
19- file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po)
20- foreach (PO_INPUT ${PO_FILES})
21- get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME_WE)
22- set (MO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PO_INPUT_BASE}.mo)
23- add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} -o ${MO_OUTPUT} ${PO_INPUT})
24-
25- install (FILES ${MO_OUTPUT} DESTINATION
26- ${CMAKE_INSTALL_LOCALEDIR}/${PO_INPUT_BASE}/LC_MESSAGES
27- RENAME ${NLS_PACKAGE}.mo)
28- endforeach (PO_INPUT ${PO_FILES})
29-endmacro(add_translations_directory)
30-
31-
32-macro(add_translations_catalog NLS_PACKAGE)
33- add_custom_target (pot COMMENT “Building translation catalog.”)
34- find_program (XGETTEXT_EXECUTABLE xgettext)
35-
36- # init this list, which will hold all the sources across all dirs
37- set(SOURCES "")
38-
39- # add each directory's sources to the overall sources list
40- foreach(FILES_INPUT ${ARGN})
41- set (DIR ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT})
42- file (GLOB_RECURSE DIR_SOURCES ${DIR}/*.c ${DIR}/*.cc ${DIR}/*.cpp ${DIR}/*.cxx ${DIR}/*.vala)
43- set (SOURCES ${SOURCES} ${DIR_SOURCES})
44- endforeach()
45-
46- add_custom_command (TARGET pot COMMAND
47- ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot
48- ${SOURCES} --keyword="_" --keyword="N_" --from-code=UTF-8
49- )
50-endmacro()
51
52=== modified file 'debian/control'
53--- debian/control 2017-02-07 20:22:02 +0000
54+++ debian/control 2017-02-07 20:22:02 +0000
55@@ -4,7 +4,10 @@
56 Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>
57 Build-Depends: cmake,
58 cmake-extras (>= 0.10),
59+ debhelper (>= 9),
60+ dh-translations,
61 gcovr,
62+ intltool,
63 lcov,
64 libnotify-dev (>= 0.7.6),
65 libglib2.0-dev (>= 2.36),
66@@ -13,10 +16,6 @@
67 python:any,
68 # for com.ubuntu.touch.AccountsService.Sound.xml
69 accountsservice-ubuntu-schemas,
70-# for packaging
71- debhelper (>= 9),
72- dh-translations,
73- intltool,
74 # for tests
75 googletest | google-mock,
76 python3-dbusmock,
77
78=== modified file 'po/CMakeLists.txt'
79--- po/CMakeLists.txt 2014-07-16 23:29:24 +0000
80+++ po/CMakeLists.txt 2017-02-07 20:22:02 +0000
81@@ -1,3 +1,12 @@
82-include (Translations)
83-add_translations_directory ("${GETTEXT_PACKAGE}")
84-add_translations_catalog ("${GETTEXT_PACKAGE}" ../src/)
85+find_package(Intltool REQUIRED)
86+
87+intltool_update_potfile(
88+ KEYWORDS "_" "_:1,2" "N_" "N_:1,2"
89+ GETTEXT_PACKAGE ${GETTEXT_PACKAGE}
90+ COPYRIGHT_HOLDER "Canonical Ltd."
91+)
92+
93+intltool_install_translations(
94+ ALL
95+ GETTEXT_PACKAGE ${GETTEXT_PACKAGE}
96+)
97
98=== removed file 'po/POTFILES.in'
99--- po/POTFILES.in 2014-10-14 09:00:13 +0000
100+++ po/POTFILES.in 1970-01-01 00:00:00 +0000
101@@ -1,4 +0,0 @@
102-data/com.canonical.indicator.power.gschema.xml.in
103-src/device.c
104-src/notifier.c
105-src/service.c
106
107=== added file 'po/indicator-power.pot'
108--- po/indicator-power.pot 1970-01-01 00:00:00 +0000
109+++ po/indicator-power.pot 2017-02-07 20:22:02 +0000
110@@ -0,0 +1,217 @@
111+# SOME DESCRIPTIVE TITLE.
112+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
113+# This file is distributed under the same license as the PACKAGE package.
114+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
115+#
116+#, fuzzy
117+msgid ""
118+msgstr ""
119+"Project-Id-Version: PACKAGE VERSION\n"
120+"Report-Msgid-Bugs-To: \n"
121+"POT-Creation-Date: 2017-02-07 15:18-0500\n"
122+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
123+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
124+"Language-Team: LANGUAGE <LL@li.org>\n"
125+"Language: \n"
126+"MIME-Version: 1.0\n"
127+"Content-Type: text/plain; charset=UTF-8\n"
128+"Content-Transfer-Encoding: 8bit\n"
129+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
130+
131+#. TRANSLATORS: system power cord
132+#: ../src/device.c:524
133+msgid "AC Adapter"
134+msgstr ""
135+
136+#. TRANSLATORS: laptop primary battery
137+#: ../src/device.c:528 ../src/service.c:442
138+msgid "Battery"
139+msgstr ""
140+
141+#. TRANSLATORS: battery-backed AC power source
142+#: ../src/device.c:532
143+msgid "UPS"
144+msgstr ""
145+
146+#. TRANSLATORS: a monitor is a device to measure voltage and current
147+#: ../src/device.c:536
148+msgid "Monitor"
149+msgstr ""
150+
151+#. TRANSLATORS: wireless mice with internal batteries
152+#: ../src/device.c:540
153+msgid "Mouse"
154+msgstr ""
155+
156+#. TRANSLATORS: wireless keyboard with internal battery
157+#: ../src/device.c:544
158+msgid "Keyboard"
159+msgstr ""
160+
161+#. TRANSLATORS: portable device
162+#: ../src/device.c:548
163+msgid "PDA"
164+msgstr ""
165+
166+#. TRANSLATORS: cell phone (mobile...)
167+#: ../src/device.c:552
168+msgid "Cell phone"
169+msgstr ""
170+
171+#. TRANSLATORS: media player, mp3 etc
172+#: ../src/device.c:556
173+msgid "Media player"
174+msgstr ""
175+
176+#. TRANSLATORS: tablet device
177+#: ../src/device.c:560
178+msgid "Tablet"
179+msgstr ""
180+
181+#. TRANSLATORS: tablet device
182+#: ../src/device.c:564
183+msgid "Computer"
184+msgstr ""
185+
186+#. TRANSLATORS: unknown device
187+#: ../src/device.c:568
188+msgid "Unknown"
189+msgstr ""
190+
191+#: ../src/device.c:608
192+#, c-format
193+msgid "estimating…"
194+msgstr ""
195+
196+#: ../src/device.c:612
197+#, c-format
198+msgid "unknown"
199+msgstr ""
200+
201+#. TRANSLATORS: H:MM (hours, minutes) to charge the battery. Example: "1:30 to charge"
202+#: ../src/device.c:641
203+#, c-format
204+msgid "%0d:%02d to charge"
205+msgstr ""
206+
207+#. TRANSLATORS: H:MM (hours, minutes) to discharge the battery. Example: "1:30 left"
208+#: ../src/device.c:646
209+#, c-format
210+msgid "%0d:%02d left"
211+msgstr ""
212+
213+#. TRANSLATORS: "X (hour,hours) Y (minute,minutes) to charge" the battery.
214+#. Example: "1 hour 10 minutes to charge"
215+#: ../src/device.c:681
216+#, c-format
217+msgid "%d %s %d %s to charge"
218+msgstr ""
219+
220+#: ../src/device.c:682 ../src/device.c:700
221+msgid "hour"
222+msgid_plural "hours"
223+msgstr[0] ""
224+msgstr[1] ""
225+
226+#: ../src/device.c:683 ../src/device.c:690 ../src/device.c:701
227+#: ../src/device.c:708
228+msgid "minute"
229+msgid_plural "minutes"
230+msgstr[0] ""
231+msgstr[1] ""
232+
233+#. TRANSLATORS: "Y (minute,minutes) to charge" the battery.
234+#. Example: "59 minutes to charge"
235+#: ../src/device.c:689
236+#, c-format
237+msgid "%d %s to charge"
238+msgstr ""
239+
240+#. TRANSLATORS: "X (hour,hours) Y (minute,minutes) left" until the battery's empty.
241+#. Example: "1 hour 10 minutes left"
242+#: ../src/device.c:699
243+#, c-format
244+msgid "%d %s %d %s left"
245+msgstr ""
246+
247+#. TRANSLATORS: "Y (minute,minutes) left" until the battery's empty.
248+#. Example: "59 minutes left"
249+#: ../src/device.c:707
250+#, c-format
251+msgid "%d %s left"
252+msgstr ""
253+
254+#. TRANSLATORS: example: "battery (charged)"
255+#: ../src/device.c:764
256+#, c-format
257+msgid "%s (charged)"
258+msgstr ""
259+
260+#. TRANSLATORS: example: "battery (time remaining)"
261+#: ../src/device.c:781
262+#, c-format
263+msgid "%s (%s)"
264+msgstr ""
265+
266+#. TRANSLATORS: after the icon, a time-remaining string + battery %. Example: "(0:59, 33%)"
267+#: ../src/device.c:853
268+#, c-format
269+msgid "(%s, %.0lf%%)"
270+msgstr ""
271+
272+#. TRANSLATORS: after the icon, a time-remaining string Example: "(0:59)"
273+#: ../src/device.c:858
274+#, c-format
275+msgid "(%s)"
276+msgstr ""
277+
278+#. TRANSLATORS: after the icon, a battery %. Example: "(33%)"
279+#: ../src/device.c:863
280+#, c-format
281+msgid "(%.0lf%%)"
282+msgstr ""
283+
284+#: ../src/notifier.c:286
285+msgid "Battery Low"
286+msgstr ""
287+
288+#: ../src/notifier.c:287
289+msgid "Battery Critical"
290+msgstr ""
291+
292+#: ../src/notifier.c:289
293+#, c-format
294+msgid "%.0f%% charge remaining"
295+msgstr ""
296+
297+#: ../src/notifier.c:321
298+msgid "OK"
299+msgstr ""
300+
301+#: ../src/notifier.c:322
302+msgid "Battery settings"
303+msgstr ""
304+
305+#: ../src/service.c:567
306+msgid "Charge level"
307+msgstr ""
308+
309+#: ../src/service.c:635
310+msgid "Show Time in Menu Bar"
311+msgstr ""
312+
313+#: ../src/service.c:639
314+msgid "Show Percentage in Menu Bar"
315+msgstr ""
316+
317+#: ../src/service.c:643
318+msgid "Power Settings…"
319+msgstr ""
320+
321+#: ../src/service.c:669
322+msgid "Adjust brightness automatically"
323+msgstr ""
324+
325+#: ../src/service.c:675
326+msgid "Battery settings…"
327+msgstr ""

Subscribers

People subscribed via source and target branches