Merge lp:~thomas-voss/location-service/fix-1354092 into lp:location-service/trunk

Proposed by Thomas Voß
Status: Merged
Approved by: Alberto Aguirre
Approved revision: 111
Merged at revision: 113
Proposed branch: lp:~thomas-voss/location-service/fix-1354092
Merge into: lp:location-service/trunk
Diff against target: 190 lines (+110/-9)
7 files modified
CMakeLists.txt (+1/-0)
data/ubuntu-location-service-trust-stored.conf.in (+1/-0)
debian/ubuntu-location-service-bin.install (+1/-0)
po/CMakeLists.txt (+37/-0)
po/de.po (+30/-0)
po/ubuntu-location-service.pot (+26/-0)
src/location_service/com/ubuntu/location/service/trust_store_permission_manager.cpp (+14/-9)
To merge this branch: bzr merge lp:~thomas-voss/location-service/fix-1354092
Reviewer Review Type Date Requested Status
Martin Pitt Approve
Alberto Aguirre (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Loïc Minier Approve
Manuel de la Peña (community) Approve
Review via email: mp+235225@code.launchpad.net

Commit message

Make the service translateable.

Description of the change

Make the service translateable.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Loïc Minier (lool) wrote :

This fails to build; could it be because of .mo files and langpacks?

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Manuel de la Peña (mandel) :
review: Approve
Revision history for this message
Loïc Minier (lool) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
111. By Thomas Voß

[ thomas-voss ]
* Implement heuristic to invalidate 3G cells after 60 seconds. (LP:
  #1371514)
[ thomas-voss ]
* Expose remote::Interface and respective stub/skeleton for using and
  exposing remote location providers.
* Add a standalone daemon for executing providers out of process.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

LGTM

review: Approve
112. By Thomas Voß

Mark source package as using langpacks.

113. By Thomas Voß

Remove langpack marker as location-service is in main.

Revision history for this message
Martin Pitt (pitti) wrote :

packaging ack, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2014-07-31 09:57:46 +0000
3+++ CMakeLists.txt 2014-10-08 09:05:02 +0000
4@@ -78,6 +78,7 @@
5 add_subdirectory(doc)
6 add_subdirectory(examples)
7 add_subdirectory(include)
8+add_subdirectory(po)
9 add_subdirectory(src)
10 add_subdirectory(tests)
11
12
13=== modified file 'data/ubuntu-location-service-trust-stored.conf.in'
14--- data/ubuntu-location-service-trust-stored.conf.in 2014-09-15 18:26:04 +0000
15+++ data/ubuntu-location-service-trust-stored.conf.in 2014-10-08 09:05:02 +0000
16@@ -18,5 +18,6 @@
17 --local-agent MirAgent \
18 --trusted-mir-socket=/var/run/user/$(id -u)/mir_socket_trusted \
19 --for-service UbuntuLocationService \
20+ --with-text-domain ubuntu-location-service \
21 --store-bus session
22 end script
23
24=== modified file 'debian/ubuntu-location-service-bin.install'
25--- debian/ubuntu-location-service-bin.install 2014-09-17 13:26:15 +0000
26+++ debian/ubuntu-location-service-bin.install 2014-10-08 09:05:02 +0000
27@@ -1,5 +1,6 @@
28 etc/dbus-1/system.d/
29 etc/init/*
30+usr/share/locale/*
31 usr/share/upstart/sessions/ubuntu-location-service-trust-stored.conf
32 usr/bin/ubuntu-location-service-providerd
33 usr/bin/ubuntu-location-serviced
34
35=== added directory 'po'
36=== added file 'po/CMakeLists.txt'
37--- po/CMakeLists.txt 1970-01-01 00:00:00 +0000
38+++ po/CMakeLists.txt 2014-10-08 09:05:02 +0000
39@@ -0,0 +1,37 @@
40+include(FindGettext REQUIRED)
41+find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext)
42+
43+set(DOMAIN ubuntu-location-service)
44+set(POT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${DOMAIN}.pot)
45+file(GLOB PO_FILES *.po)
46+
47+# We look through all source files and find
48+# usages of i18n::tr.
49+file(
50+ GLOB_RECURSE I18N_CPP_SRC_FILES
51+ ${CMAKE_SOURCE_DIR}/src/*.cpp)
52+
53+list(SORT I18N_CPP_SRC_FILES)
54+
55+add_custom_target(
56+ ubuntu-location-service-pot
57+ COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE}
58+ --default-domain=ubuntu-location-service
59+ --output=${POT_FILE}
60+ --from-code=UTF-8
61+ --c++ --add-comments=TRANSLATORS
62+ --keyword='tr'
63+ --boost
64+ --package-name=ubuntu-location-service
65+ --copyright-holder='Canonical Ltd.'
66+ ${I18N_CPP_SRC_FILES})
67+
68+foreach(PO_FILE ${PO_FILES})
69+ get_filename_component(LANG ${PO_FILE} NAME_WE)
70+ gettext_process_po_files(${LANG} ALL PO_FILES ${PO_FILE})
71+ set(INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR}/${LANG}/LC_MESSAGES)
72+ install(
73+ FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo
74+ DESTINATION ${INSTALL_DIR}
75+ RENAME ${DOMAIN}.mo)
76+endforeach(PO_FILE)
77
78=== added file 'po/de.po'
79--- po/de.po 1970-01-01 00:00:00 +0000
80+++ po/de.po 2014-10-08 09:05:02 +0000
81@@ -0,0 +1,30 @@
82+# Copyright (C) 2014 Canonical Ltd.
83+# This file is distributed under the same license as the ubuntu-location-service package.
84+# Thomas Voß <thomas.voss@canonical.com>, 2014.
85+#
86+msgid ""
87+msgstr ""
88+"Project-Id-Version: ubuntu-location-service\n"
89+"Report-Msgid-Bugs-To: \n"
90+"POT-Creation-Date: 2014-09-19 01:04+0200\n"
91+"PO-Revision-Date: 2014-09-19 09:27+0100\n"
92+"Last-Translator: Thomas Voß <thomas.voss@canonical.com>\n"
93+"Language-Team: \n"
94+"MIME-Version: 1.0\n"
95+"Content-Type: text/plain; charset=UTF-8\n"
96+"Content-Transfer-Encoding: 8bit\n"
97+"X-Generator: Poedit 1.5.4\n"
98+"Language: DE\n"
99+
100+#: /tmp/i18n/src/location_service/com/ubuntu/location/service/trust_store_permission_manager.cpp:170
101+msgid "An unconfined application wants to access your current location."
102+msgstr ""
103+"Eine App mit uneingeschränkten Zugriffsrechten möchte auf Ihre aktuelle "
104+"Position zugreifen. Möchten Sie dieser Applikation vertrauen?"
105+
106+#: /tmp/i18n/src/location_service/com/ubuntu/location/service/trust_store_permission_manager.cpp:173
107+#, boost-format
108+msgid "%1% wants to access your current location."
109+msgstr ""
110+"%1% will auf Ihre aktuelle Position zugreifen. Möchten Sie dieser "
111+"Applikation vertrauen?"
112
113=== added file 'po/ubuntu-location-service.pot'
114--- po/ubuntu-location-service.pot 1970-01-01 00:00:00 +0000
115+++ po/ubuntu-location-service.pot 2014-10-08 09:05:02 +0000
116@@ -0,0 +1,26 @@
117+# Copyright (C) 2014 Canonical Ltd.
118+# This file is distributed under the same license as the ubuntu-location-service package.
119+# Thomas Voß <thomas.voss@canonical.com>, 2014.
120+#
121+#, fuzzy
122+msgid ""
123+msgstr ""
124+"Project-Id-Version: ubuntu-location-service\n"
125+"Report-Msgid-Bugs-To: \n"
126+"POT-Creation-Date: 2014-09-19 01:04+0200\n"
127+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
128+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
129+"Language-Team: LANGUAGE <LL@li.org>\n"
130+"Language: \n"
131+"MIME-Version: 1.0\n"
132+"Content-Type: text/plain; charset=CHARSET\n"
133+"Content-Transfer-Encoding: 8bit\n"
134+
135+#: /tmp/i18n/src/location_service/com/ubuntu/location/service/trust_store_permission_manager.cpp:170
136+msgid "An unconfined application wants to access your current location."
137+msgstr ""
138+
139+#: /tmp/i18n/src/location_service/com/ubuntu/location/service/trust_store_permission_manager.cpp:173
140+#, boost-format
141+msgid "%1% wants to access your current location."
142+msgstr ""
143
144=== modified file 'src/location_service/com/ubuntu/location/service/trust_store_permission_manager.cpp'
145--- src/location_service/com/ubuntu/location/service/trust_store_permission_manager.cpp 2014-08-14 20:31:09 +0000
146+++ src/location_service/com/ubuntu/location/service/trust_store_permission_manager.cpp 2014-10-08 09:05:02 +0000
147@@ -28,6 +28,8 @@
148
149 #include <core/posix/this_process.h>
150
151+#include <boost/format.hpp>
152+
153 #include <sys/apparmor.h>
154
155 namespace location = com::ubuntu::location;
156@@ -42,6 +44,17 @@
157 "0") == "1";
158
159 }
160+
161+namespace i18n
162+{
163+// We only tag strings that should be translated but do not do the actual translation.
164+// Point is: The service might run in a system context, without correct locale information.
165+// We leave the translation to in-session trust-store instances.
166+std::string tr(const std::string& msg)
167+{
168+ return msg;
169+}
170+}
171 }
172
173 service::TrustStorePermissionManager::AppArmorProfileResolver service::TrustStorePermissionManager::libapparmor_profile_resolver()
174@@ -133,15 +146,7 @@
175 return service::PermissionManager::Result::rejected;
176 }
177
178- std::string description;
179-
180- if (profile == "unconfined")
181- {
182- description = "An unconfined application wants to access your current location.";
183- } else
184- {
185- description = profile + " wants to access your current location.";
186- }
187+ std::string description = i18n::tr("%1% wants to access your current location.");
188
189 core::trust::Agent::RequestParameters params
190 {

Subscribers

People subscribed via source and target branches