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

Proposed by dobey
Status: Merged
Approved by: dobey
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
Pete Woods (community) Approve
unity-api-1-bot continuous-integration Approve
Review via email: mp+316624@code.launchpad.net

Commit message

Use intltool support from cmake-extras.

To post a comment you must log in.
Revision history for this message
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)
Revision history for this message
Pete Woods (pete-woods) :
review: Approve
Revision history for this message
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
=== added file '.bzrignore'
--- .bzrignore 1970-01-01 00:00:00 +0000
+++ .bzrignore 2017-02-07 20:22:02 +0000
@@ -0,0 +1,4 @@
1build/
2po/Makefile.in.in
3po/POTFILES.in
4
05
=== removed file 'cmake/Translations.cmake'
--- cmake/Translations.cmake 2014-08-09 23:19:02 +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 'debian/control'
--- debian/control 2017-02-07 20:22:02 +0000
+++ debian/control 2017-02-07 20:22:02 +0000
@@ -4,7 +4,10 @@
4Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>4Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5Build-Depends: cmake,5Build-Depends: cmake,
6 cmake-extras (>= 0.10),6 cmake-extras (>= 0.10),
7 debhelper (>= 9),
8 dh-translations,
7 gcovr,9 gcovr,
10 intltool,
8 lcov,11 lcov,
9 libnotify-dev (>= 0.7.6),12 libnotify-dev (>= 0.7.6),
10 libglib2.0-dev (>= 2.36),13 libglib2.0-dev (>= 2.36),
@@ -13,10 +16,6 @@
13 python:any,16 python:any,
14# for com.ubuntu.touch.AccountsService.Sound.xml17# for com.ubuntu.touch.AccountsService.Sound.xml
15 accountsservice-ubuntu-schemas,18 accountsservice-ubuntu-schemas,
16# for packaging
17 debhelper (>= 9),
18 dh-translations,
19 intltool,
20# for tests19# for tests
21 googletest | google-mock,20 googletest | google-mock,
22 python3-dbusmock,21 python3-dbusmock,
2322
=== modified file 'po/CMakeLists.txt'
--- po/CMakeLists.txt 2014-07-16 23:29:24 +0000
+++ po/CMakeLists.txt 2017-02-07 20:22:02 +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 2014-10-14 09:00:13 +0000
+++ po/POTFILES.in 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
1data/com.canonical.indicator.power.gschema.xml.in
2src/device.c
3src/notifier.c
4src/service.c
50
=== added file 'po/indicator-power.pot'
--- po/indicator-power.pot 1970-01-01 00:00:00 +0000
+++ po/indicator-power.pot 2017-02-07 20:22:02 +0000
@@ -0,0 +1,217 @@
1# SOME DESCRIPTIVE TITLE.
2# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3# This file is distributed under the same license as the PACKAGE package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5#
6#, fuzzy
7msgid ""
8msgstr ""
9"Project-Id-Version: PACKAGE VERSION\n"
10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2017-02-07 15:18-0500\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
15"Language: \n"
16"MIME-Version: 1.0\n"
17"Content-Type: text/plain; charset=UTF-8\n"
18"Content-Transfer-Encoding: 8bit\n"
19"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
20
21#. TRANSLATORS: system power cord
22#: ../src/device.c:524
23msgid "AC Adapter"
24msgstr ""
25
26#. TRANSLATORS: laptop primary battery
27#: ../src/device.c:528 ../src/service.c:442
28msgid "Battery"
29msgstr ""
30
31#. TRANSLATORS: battery-backed AC power source
32#: ../src/device.c:532
33msgid "UPS"
34msgstr ""
35
36#. TRANSLATORS: a monitor is a device to measure voltage and current
37#: ../src/device.c:536
38msgid "Monitor"
39msgstr ""
40
41#. TRANSLATORS: wireless mice with internal batteries
42#: ../src/device.c:540
43msgid "Mouse"
44msgstr ""
45
46#. TRANSLATORS: wireless keyboard with internal battery
47#: ../src/device.c:544
48msgid "Keyboard"
49msgstr ""
50
51#. TRANSLATORS: portable device
52#: ../src/device.c:548
53msgid "PDA"
54msgstr ""
55
56#. TRANSLATORS: cell phone (mobile...)
57#: ../src/device.c:552
58msgid "Cell phone"
59msgstr ""
60
61#. TRANSLATORS: media player, mp3 etc
62#: ../src/device.c:556
63msgid "Media player"
64msgstr ""
65
66#. TRANSLATORS: tablet device
67#: ../src/device.c:560
68msgid "Tablet"
69msgstr ""
70
71#. TRANSLATORS: tablet device
72#: ../src/device.c:564
73msgid "Computer"
74msgstr ""
75
76#. TRANSLATORS: unknown device
77#: ../src/device.c:568
78msgid "Unknown"
79msgstr ""
80
81#: ../src/device.c:608
82#, c-format
83msgid "estimating…"
84msgstr ""
85
86#: ../src/device.c:612
87#, c-format
88msgid "unknown"
89msgstr ""
90
91#. TRANSLATORS: H:MM (hours, minutes) to charge the battery. Example: "1:30 to charge"
92#: ../src/device.c:641
93#, c-format
94msgid "%0d:%02d to charge"
95msgstr ""
96
97#. TRANSLATORS: H:MM (hours, minutes) to discharge the battery. Example: "1:30 left"
98#: ../src/device.c:646
99#, c-format
100msgid "%0d:%02d left"
101msgstr ""
102
103#. TRANSLATORS: "X (hour,hours) Y (minute,minutes) to charge" the battery.
104#. Example: "1 hour 10 minutes to charge"
105#: ../src/device.c:681
106#, c-format
107msgid "%d %s %d %s to charge"
108msgstr ""
109
110#: ../src/device.c:682 ../src/device.c:700
111msgid "hour"
112msgid_plural "hours"
113msgstr[0] ""
114msgstr[1] ""
115
116#: ../src/device.c:683 ../src/device.c:690 ../src/device.c:701
117#: ../src/device.c:708
118msgid "minute"
119msgid_plural "minutes"
120msgstr[0] ""
121msgstr[1] ""
122
123#. TRANSLATORS: "Y (minute,minutes) to charge" the battery.
124#. Example: "59 minutes to charge"
125#: ../src/device.c:689
126#, c-format
127msgid "%d %s to charge"
128msgstr ""
129
130#. TRANSLATORS: "X (hour,hours) Y (minute,minutes) left" until the battery's empty.
131#. Example: "1 hour 10 minutes left"
132#: ../src/device.c:699
133#, c-format
134msgid "%d %s %d %s left"
135msgstr ""
136
137#. TRANSLATORS: "Y (minute,minutes) left" until the battery's empty.
138#. Example: "59 minutes left"
139#: ../src/device.c:707
140#, c-format
141msgid "%d %s left"
142msgstr ""
143
144#. TRANSLATORS: example: "battery (charged)"
145#: ../src/device.c:764
146#, c-format
147msgid "%s (charged)"
148msgstr ""
149
150#. TRANSLATORS: example: "battery (time remaining)"
151#: ../src/device.c:781
152#, c-format
153msgid "%s (%s)"
154msgstr ""
155
156#. TRANSLATORS: after the icon, a time-remaining string + battery %. Example: "(0:59, 33%)"
157#: ../src/device.c:853
158#, c-format
159msgid "(%s, %.0lf%%)"
160msgstr ""
161
162#. TRANSLATORS: after the icon, a time-remaining string Example: "(0:59)"
163#: ../src/device.c:858
164#, c-format
165msgid "(%s)"
166msgstr ""
167
168#. TRANSLATORS: after the icon, a battery %. Example: "(33%)"
169#: ../src/device.c:863
170#, c-format
171msgid "(%.0lf%%)"
172msgstr ""
173
174#: ../src/notifier.c:286
175msgid "Battery Low"
176msgstr ""
177
178#: ../src/notifier.c:287
179msgid "Battery Critical"
180msgstr ""
181
182#: ../src/notifier.c:289
183#, c-format
184msgid "%.0f%% charge remaining"
185msgstr ""
186
187#: ../src/notifier.c:321
188msgid "OK"
189msgstr ""
190
191#: ../src/notifier.c:322
192msgid "Battery settings"
193msgstr ""
194
195#: ../src/service.c:567
196msgid "Charge level"
197msgstr ""
198
199#: ../src/service.c:635
200msgid "Show Time in Menu Bar"
201msgstr ""
202
203#: ../src/service.c:639
204msgid "Show Percentage in Menu Bar"
205msgstr ""
206
207#: ../src/service.c:643
208msgid "Power Settings…"
209msgstr ""
210
211#: ../src/service.c:669
212msgid "Adjust brightness automatically"
213msgstr ""
214
215#: ../src/service.c:675
216msgid "Battery settings…"
217msgstr ""

Subscribers

People subscribed via source and target branches