Merge lp:~bhdouglass/rockwork/translations into lp:rockwork
- translations
- Merge into trunk
Proposed by
Brian Douglass
Status: | Merged |
---|---|
Merged at revision: | 28 |
Proposed branch: | lp:~bhdouglass/rockwork/translations |
Merge into: | lp:rockwork |
Diff against target: |
427 lines (+146/-71) 9 files modified
po/rockwork.mzanetti.pot (+74/-0) po/template.pot (+0/-22) po/upebble.mzanetti.pot (+0/-30) rockwork/InstalledAppsPage.qml (+5/-1) rockwork/MainMenuPage.qml (+28/-5) rockwork/NotificationsPage.qml (+12/-6) rockwork/PebblesPage.qml (+10/-6) rockwork/pebbles.cpp (+16/-1) rockwork/pebbles.h (+1/-0) |
To merge this branch: | bzr merge lp:~bhdouglass/rockwork/translations |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Zanetti | Approve | ||
Review via email: mp+281338@code.launchpad.net |
Commit message
Description of the change
Added translation support and added sorting of the Pebble list
To post a comment you must log in.
- 29. By Brian Douglass
-
Updated text references to Pebble and removed unneeded Item
- 30. By Brian Douglass
-
Updated pot file
Revision history for this message
Brian Douglass (bhdouglass) wrote : | # |
I wasn't event thinking about the trademark stuff, got call!
Revision history for this message
Michael Zanetti (mzanetti) wrote : | # |
Ok. merged it. There was a bug. The installed apps/watchfaces model was broken. Apparently dynamicRoles: true only works properly if the first inserted item has all the roles. In our case, the showWatchApps and showWatchFaces properties are not in the first one so those broke. Anyhow, I've fixed that before merging.
review:
Approve
Revision history for this message
Brian Douglass (bhdouglass) wrote : | # |
Ah, sorry about that, I didn't even notice!
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file 'po/rockwork.mzanetti.pot' |
2 | --- po/rockwork.mzanetti.pot 1970-01-01 00:00:00 +0000 |
3 | +++ po/rockwork.mzanetti.pot 2015-12-25 04:59:18 +0000 |
4 | @@ -0,0 +1,74 @@ |
5 | +# SOME DESCRIPTIVE TITLE. |
6 | +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER |
7 | +# This file is distributed under the same license as the PACKAGE package. |
8 | +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
9 | +# |
10 | +#, fuzzy |
11 | +msgid "" |
12 | +msgstr "" |
13 | +"Project-Id-Version: PACKAGE VERSION\n" |
14 | +"Report-Msgid-Bugs-To: \n" |
15 | +"POT-Creation-Date: 2015-12-25 04:54+0000\n" |
16 | +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
17 | +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
18 | +"Language-Team: LANGUAGE <LL@li.org>\n" |
19 | +"Language: \n" |
20 | +"MIME-Version: 1.0\n" |
21 | +"Content-Type: text/plain; charset=CHARSET\n" |
22 | +"Content-Transfer-Encoding: 8bit\n" |
23 | + |
24 | +#: /home/vagrant/translations/rockwork/InstalledAppsPage.qml:8 |
25 | +msgid "Apps & Watchfaces" |
26 | +msgstr "" |
27 | + |
28 | +#: /home/vagrant/translations/rockwork/InstalledAppsPage.qml:8 |
29 | +msgid "Apps" |
30 | +msgstr "" |
31 | + |
32 | +#: /home/vagrant/translations/rockwork/InstalledAppsPage.qml:8 |
33 | +msgid "Watchfaces" |
34 | +msgstr "" |
35 | + |
36 | +#: /home/vagrant/translations/rockwork/MainMenuPage.qml:20 |
37 | +msgid "Manage notifications" |
38 | +msgstr "" |
39 | + |
40 | +#: /home/vagrant/translations/rockwork/MainMenuPage.qml:26 |
41 | +msgid "Manage Apps" |
42 | +msgstr "" |
43 | + |
44 | +#: /home/vagrant/translations/rockwork/MainMenuPage.qml:33 |
45 | +msgid "Manage Watchfaces" |
46 | +msgstr "" |
47 | + |
48 | +#: /home/vagrant/translations/rockwork/NotificationsPage.qml:7 |
49 | +msgid "Notifications" |
50 | +msgstr "" |
51 | + |
52 | +#: /home/vagrant/translations/rockwork/NotificationsPage.qml:26 |
53 | +msgid "" |
54 | +"Entries here will appear as notifications keep coming. Selected " |
55 | +"notifications will be shown on your Pebble smartwatch." |
56 | +msgstr "" |
57 | + |
58 | +#: /home/vagrant/translations/rockwork/PebblesPage.qml:6 |
59 | +msgid "Manage Pebble Watches" |
60 | +msgstr "" |
61 | + |
62 | +#: /home/vagrant/translations/rockwork/PebblesPage.qml:36 |
63 | +msgid "Connected" |
64 | +msgstr "" |
65 | + |
66 | +#: /home/vagrant/translations/rockwork/PebblesPage.qml:36 |
67 | +msgid "Disconnected" |
68 | +msgstr "" |
69 | + |
70 | +#: /home/vagrant/translations/rockwork/PebblesPage.qml:55 |
71 | +msgid "" |
72 | +"No Pebble smartwatches configured yet. Please connect your Pebble watch " |
73 | +"using the system settings." |
74 | +msgstr "" |
75 | + |
76 | +#: /home/vagrant/translations/rockwork/PebblesPage.qml:62 |
77 | +msgid "Open system settings" |
78 | +msgstr "" |
79 | |
80 | === removed file 'po/template.pot' |
81 | --- po/template.pot 2015-11-21 22:55:06 +0000 |
82 | +++ po/template.pot 1970-01-01 00:00:00 +0000 |
83 | @@ -1,22 +0,0 @@ |
84 | -# SOME DESCRIPTIVE TITLE. |
85 | -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER |
86 | -# This file is distributed under the same license as the PACKAGE package. |
87 | -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
88 | -# |
89 | -#, fuzzy |
90 | -msgid "" |
91 | -msgstr "" |
92 | -"Project-Id-Version: PACKAGE VERSION\n" |
93 | -"Report-Msgid-Bugs-To: \n" |
94 | -"POT-Creation-Date: 2015-11-21 03:34+0100\n" |
95 | -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
96 | -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
97 | -"Language-Team: LANGUAGE <LL@li.org>\n" |
98 | -"Language: \n" |
99 | -"MIME-Version: 1.0\n" |
100 | -"Content-Type: text/plain; charset=CHARSET\n" |
101 | -"Content-Transfer-Encoding: 8bit\n" |
102 | - |
103 | -#: /home/micha/Develop/upebble/upebble/Main.qml:39 |
104 | -msgid "Notifications" |
105 | -msgstr "" |
106 | |
107 | === removed file 'po/upebble.mzanetti.pot' |
108 | --- po/upebble.mzanetti.pot 2015-11-21 22:55:06 +0000 |
109 | +++ po/upebble.mzanetti.pot 1970-01-01 00:00:00 +0000 |
110 | @@ -1,30 +0,0 @@ |
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: 2015-11-19 23:50+0100\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=CHARSET\n" |
128 | -"Content-Transfer-Encoding: 8bit\n" |
129 | - |
130 | -#: /home/micha/Develop/upebble/upebble/Main.qml:15 |
131 | -msgid "upebble" |
132 | -msgstr "" |
133 | - |
134 | -#: /home/micha/Develop/upebble/upebble/Main.qml:28 |
135 | -msgid "Hello.." |
136 | -msgstr "" |
137 | - |
138 | -#: /home/micha/Develop/upebble/upebble/Main.qml:35 |
139 | -msgid "Tap me!" |
140 | -msgstr "" |
141 | |
142 | === modified file 'rockwork/InstalledAppsPage.qml' |
143 | --- rockwork/InstalledAppsPage.qml 2015-12-21 03:46:24 +0000 |
144 | +++ rockwork/InstalledAppsPage.qml 2015-12-25 04:59:18 +0000 |
145 | @@ -5,7 +5,7 @@ |
146 | |
147 | Page { |
148 | id: root |
149 | - title: showWatchApps ? (showWatchFaces ? "Apps & Watchfaces" : "Apps") : "Watchfaces" |
150 | + title: showWatchApps ? (showWatchFaces ? i18n.tr("Apps & Watchfaces") : i18n.tr("Apps")) : i18n.tr("Watchfaces") |
151 | |
152 | property var pebble: null |
153 | property bool showWatchApps: false |
154 | @@ -34,23 +34,27 @@ |
155 | } |
156 | ] |
157 | } |
158 | + |
159 | RowLayout { |
160 | anchors { |
161 | fill: parent |
162 | margins: units.gu(1) |
163 | } |
164 | spacing: units.gu(1) |
165 | + |
166 | Image { |
167 | Layout.fillHeight: true |
168 | Layout.preferredWidth: height |
169 | source: "file://" + model.icon |
170 | } |
171 | + |
172 | ColumnLayout { |
173 | Layout.fillWidth: true |
174 | Label { |
175 | text: model.name |
176 | Layout.fillWidth: true |
177 | } |
178 | + |
179 | Label { |
180 | text: model.vendor |
181 | Layout.fillWidth: true |
182 | |
183 | === modified file 'rockwork/MainMenuPage.qml' |
184 | --- rockwork/MainMenuPage.qml 2015-12-21 03:46:24 +0000 |
185 | +++ rockwork/MainMenuPage.qml 2015-12-25 04:59:18 +0000 |
186 | @@ -8,11 +8,32 @@ |
187 | |
188 | property var pebble: null |
189 | |
190 | + //Creating the menu list this way to allow the text field to be translatable (http://askubuntu.com/a/476331) |
191 | ListModel { |
192 | id: mainMenuModel |
193 | - ListElement { icon: "stock_notification"; text: "Manage notifications"; page: "NotificationsPage.qml" } |
194 | - ListElement { icon: "stock_application"; text: "Manage apps"; page: "InstalledAppsPage.qml"; showWatchApps: true } |
195 | - ListElement { icon: "stock_alarm-clock"; text: "Manage watchfaces"; page: "InstalledAppsPage.qml"; showWatchFaces: true } |
196 | + dynamicRoles: true |
197 | + } |
198 | + |
199 | + Component.onCompleted: { |
200 | + mainMenuModel.append({ |
201 | + icon: "stock_notification", |
202 | + text: i18n.tr("Manage notifications"), |
203 | + page: "NotificationsPage.qml", |
204 | + }); |
205 | + |
206 | + mainMenuModel.append({ |
207 | + icon: "stock_application", |
208 | + text: i18n.tr("Manage Apps"), |
209 | + page: "InstalledAppsPage.qml", |
210 | + showWatchApps: true, |
211 | + }); |
212 | + |
213 | + mainMenuModel.append({ |
214 | + icon: "stock_alarm-clock", |
215 | + text: i18n.tr("Manage Watchfaces"), |
216 | + page: "InstalledAppsPage.qml", |
217 | + showWatchFaces: true, |
218 | + }); |
219 | } |
220 | |
221 | Column { |
222 | @@ -24,18 +45,21 @@ |
223 | RowLayout { |
224 | anchors.fill: parent |
225 | anchors.margins: units.gu(1) |
226 | + |
227 | Icon { |
228 | Layout.fillHeight: true |
229 | Layout.preferredWidth: height |
230 | implicitHeight: parent.height |
231 | implicitWidth: height |
232 | - name: model.icon |
233 | + name: model.icon |
234 | } |
235 | + |
236 | Label { |
237 | text: model.text |
238 | Layout.fillWidth: true |
239 | } |
240 | } |
241 | + |
242 | onClicked: { |
243 | var options = {}; |
244 | options["pebble"] = root.pebble |
245 | @@ -47,4 +71,3 @@ |
246 | } |
247 | } |
248 | } |
249 | - |
250 | |
251 | === modified file 'rockwork/NotificationsPage.qml' |
252 | --- rockwork/NotificationsPage.qml 2015-12-16 23:25:28 +0000 |
253 | +++ rockwork/NotificationsPage.qml 2015-12-25 04:59:18 +0000 |
254 | @@ -4,20 +4,26 @@ |
255 | import RockWork 1.0 |
256 | |
257 | Page { |
258 | - title: "Notifications" |
259 | + title: i18n.tr("Notifications") |
260 | |
261 | ColumnLayout { |
262 | anchors.fill: parent |
263 | anchors.topMargin: units.gu(1) |
264 | + |
265 | Item { |
266 | Layout.fillWidth: true |
267 | implicitHeight: infoLabel.height |
268 | |
269 | Label { |
270 | id: infoLabel |
271 | - anchors { left: parent.left; right: parent.right; margins: units.gu(1) } |
272 | + anchors { |
273 | + left: parent.left |
274 | + right: parent.right |
275 | + margins: units.gu(1) |
276 | + } |
277 | + |
278 | wrapMode: Text.WordWrap |
279 | - text: "Entries here will appear as notifications keep coming. Selected notifications will be shown on your Pebble." |
280 | + text: i18n.tr("Entries here will appear as notifications keep coming. Selected notifications will be shown on your Pebble smartwatch.") |
281 | } |
282 | } |
283 | |
284 | @@ -29,18 +35,20 @@ |
285 | model: NotificationSourceModel { |
286 | id: notificationSourceModel |
287 | } |
288 | + |
289 | delegate: ListItem { |
290 | RowLayout { |
291 | anchors.fill: parent |
292 | anchors.margins: units.gu(1) |
293 | + |
294 | Label { |
295 | text: model.name |
296 | Layout.fillWidth: true |
297 | } |
298 | + |
299 | Switch { |
300 | checked: model.enabled |
301 | onCheckedChanged: { |
302 | - print("new checked", checked) |
303 | notificationSourceModel.setEnabled(index, checked) |
304 | } |
305 | } |
306 | @@ -48,6 +56,4 @@ |
307 | } |
308 | } |
309 | } |
310 | - |
311 | } |
312 | - |
313 | |
314 | === modified file 'rockwork/PebblesPage.qml' |
315 | --- rockwork/PebblesPage.qml 2015-12-21 03:46:24 +0000 |
316 | +++ rockwork/PebblesPage.qml 2015-12-25 04:59:18 +0000 |
317 | @@ -3,7 +3,7 @@ |
318 | import Ubuntu.Components 1.3 |
319 | |
320 | Page { |
321 | - title: "Manage watches" |
322 | + title: i18n.tr("Manage Pebble Watches") |
323 | |
324 | head { |
325 | actions: [ |
326 | @@ -23,18 +23,22 @@ |
327 | RowLayout { |
328 | anchors.fill: parent |
329 | anchors.margins: units.gu(1) |
330 | + |
331 | ColumnLayout { |
332 | Layout.fillHeight: true |
333 | Layout.fillWidth: true |
334 | + |
335 | Label { |
336 | text: model.name |
337 | } |
338 | + |
339 | Label { |
340 | - text: model.connected ? "Connected" : "Disconnected" |
341 | + text: model.connected ? i18n.tr("Connected") : i18n.tr("Disconnected") |
342 | fontSize: "small" |
343 | } |
344 | } |
345 | } |
346 | + |
347 | onClicked: { |
348 | pageStack.push(Qt.resolvedUrl("MainMenuPage.qml"), {pebble: pebbles.get(index)}) |
349 | } |
350 | @@ -46,18 +50,18 @@ |
351 | width: parent.width - units.gu(4) |
352 | spacing: units.gu(4) |
353 | visible: pebbles.count === 0 |
354 | + |
355 | Label { |
356 | - text: "No Pebble set up yet. Please connect your Pebble watch using the system settings app." |
357 | + text: i18n.tr("No Pebble smartwatches configured yet. Please connect your Pebble watch using the system settings.") |
358 | fontSize: "large" |
359 | width: parent.width |
360 | wrapMode: Text.WordWrap |
361 | } |
362 | + |
363 | Button { |
364 | - text: "Open system settings" |
365 | + text: i18n.tr("Open system settings") |
366 | anchors.horizontalCenter: parent.horizontalCenter |
367 | onClicked: Qt.openUrlExternally("settings://system/bluetooth") |
368 | } |
369 | } |
370 | - |
371 | } |
372 | - |
373 | |
374 | === modified file 'rockwork/pebbles.cpp' |
375 | --- rockwork/pebbles.cpp 2015-12-16 23:25:28 +0000 |
376 | +++ rockwork/pebbles.cpp 2015-12-25 04:59:18 +0000 |
377 | @@ -6,6 +6,7 @@ |
378 | #include <QDebug> |
379 | #include <QDBusArgument> |
380 | #include <QDBusServiceWatcher> |
381 | +#include <algorithm> |
382 | |
383 | #define ROCKWORK_SERVICE QStringLiteral("org.rockwork") |
384 | #define ROCKWORK_MANAGER_PATH QStringLiteral("/org/rockwork/Manager") |
385 | @@ -118,10 +119,25 @@ |
386 | endInsertRows(); |
387 | emit countChanged(); |
388 | } |
389 | + |
390 | + std::sort(m_pebbles.begin(), m_pebbles.end(), Pebbles::sortPebbles); |
391 | } |
392 | arg.endArray(); |
393 | } |
394 | |
395 | +bool Pebbles::sortPebbles(Pebble *a, Pebble *b) |
396 | +{ |
397 | + if (a->connected() && !b->connected()) { |
398 | + return true; |
399 | + } |
400 | + else if (!a->connected() && b->connected()) { |
401 | + return false; |
402 | + } |
403 | + else { |
404 | + return a->name() < b->name(); |
405 | + } |
406 | +} |
407 | + |
408 | void Pebbles::pebbleConnectedChanged() |
409 | { |
410 | Pebble *pebble = static_cast<Pebble*>(sender()); |
411 | @@ -137,4 +153,3 @@ |
412 | } |
413 | return -1; |
414 | } |
415 | - |
416 | |
417 | === modified file 'rockwork/pebbles.h' |
418 | --- rockwork/pebbles.h 2015-12-21 03:46:24 +0000 |
419 | +++ rockwork/pebbles.h 2015-12-25 04:59:18 +0000 |
420 | @@ -45,6 +45,7 @@ |
421 | |
422 | private: |
423 | int find(const QDBusObjectPath &path) const; |
424 | + static bool sortPebbles(Pebble *a, Pebble *b); |
425 | |
426 | private: |
427 | QDBusInterface *m_iface; |
Hey, I left some comments in regard to the trademark policy. See inline replies.
Here's a link to the trademark guideline: https:/ /developer. getpebble. com/guides/ publishing- tools/pebble- trademark/