Merge lp:~sergiusens/account-polld/design_updates_for_card_strings into lp:~ubuntu-push-hackers/account-polld/trunk
- design_updates_for_card_strings
- Merge into trunk
Proposed by
Sergio Schvezov
Status: | Superseded |
---|---|
Proposed branch: | lp:~sergiusens/account-polld/design_updates_for_card_strings |
Merge into: | lp:~ubuntu-push-hackers/account-polld/trunk |
Diff against target: |
609 lines (+443/-9) (has conflicts) 11 files modified
cmd/account-polld/main.go (+5/-0) debian/changelog (+3/-0) debian/control (+2/-0) debian/copyright (+23/-1) debian/rules (+1/-0) gettext/LICENSE (+20/-0) gettext/README.md (+94/-0) gettext/gettext.go (+207/-0) plugins/gmail/gmail.go (+17/-2) plugins/twitter/twitter.go (+23/-6) po/account-polld.pot (+48/-0) Text conflict in plugins/gmail/gmail.go Text conflict in plugins/twitter/twitter.go |
To merge this branch: | bzr merge lp:~sergiusens/account-polld/design_updates_for_card_strings |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Needs Fixing | |
Roberto Alsina | Pending | ||
David Planella | Pending | ||
Review via email: mp+229160@code.launchpad.net |
This proposal has been superseded by a proposal from 2014-08-01.
Commit message
Design updates for card strings for twitter and gmail.
Description of the change
To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : | # |
review:
Needs Fixing
(continuous-integration)
- 44. By Sergio Schvezov
-
Pumping code updates from lp:~ralsina/account-polld/i18n (implies trunk)
- 45. By Sergio Schvezov
-
Add translator comments in the code
- 46. By Sergio Schvezov
-
Fixing message string and adding missing TRANSLATORS text
- 47. By Sergio Schvezov
-
recreated .pot by running xgettext -kGettext -c -o po/account-
polld.pot plugins/ gmail/gmail. go plugins/ twitter/ twitter. go - 48. By Sergio Schvezov
-
Fixing translation typos
- 49. By Sergio Schvezov
-
Updating tests
- 50. By Sergio Schvezov
-
Fixing inverse logic for address parse
Unmerged revisions
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'cmd/account-polld/main.go' |
2 | --- cmd/account-polld/main.go 2014-07-24 05:41:02 +0000 |
3 | +++ cmd/account-polld/main.go 2014-08-01 04:53:22 +0000 |
4 | @@ -25,6 +25,7 @@ |
5 | "log" |
6 | |
7 | "launchpad.net/account-polld/accounts" |
8 | + "launchpad.net/account-polld/gettext" |
9 | "launchpad.net/account-polld/plugins" |
10 | "launchpad.net/account-polld/plugins/facebook" |
11 | "launchpad.net/account-polld/plugins/gmail" |
12 | @@ -58,6 +59,10 @@ |
13 | // TODO NewAccount called here is just for playing purposes. |
14 | postWatch := make(chan *PostWatch) |
15 | |
16 | + // Initialize i18n |
17 | + gettext.SetLocale(gettext.LC_ALL, "") |
18 | + gettext.Textdomain("account-polld") |
19 | + gettext.BindTextdomain("account-polld", "/usr/share/locale") |
20 | if bus, err := dbus.Connect(dbus.SessionBus); err != nil { |
21 | log.Fatal("Cannot connect to bus", err) |
22 | } else { |
23 | |
24 | === modified file 'debian/changelog' |
25 | --- debian/changelog 2014-07-31 21:51:53 +0000 |
26 | +++ debian/changelog 2014-08-01 04:53:22 +0000 |
27 | @@ -18,6 +18,9 @@ |
28 | * Set the default sound to a path relative to an XDG_DATA_DIR as the |
29 | push client searches within those paths. |
30 | |
31 | + [ Roberto Alsina ] |
32 | + * Added i18n support |
33 | + |
34 | -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Mon, 28 Jul 2014 16:54:41 +0000 |
35 | |
36 | account-polld (0.1+14.10.20140725-0ubuntu1) utopic; urgency=low |
37 | |
38 | === modified file 'debian/control' |
39 | --- debian/control 2014-07-24 21:15:11 +0000 |
40 | +++ debian/control 2014-08-01 04:53:22 +0000 |
41 | @@ -4,6 +4,7 @@ |
42 | Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> |
43 | Build-Depends: debhelper (>= 9), |
44 | dh-golang, |
45 | + dh-translations, |
46 | golang-go, |
47 | golang-go-dbus-dev, |
48 | golang-go-xdg-dev, |
49 | @@ -29,3 +30,4 @@ |
50 | communicates with the postal service provided by the ubuntu push client |
51 | to expose notifications for the click webapps for the aforementioned |
52 | services. |
53 | +X-Ubuntu-Use-Langpack: yes |
54 | |
55 | === modified file 'debian/copyright' |
56 | --- debian/copyright 2014-07-23 18:31:38 +0000 |
57 | +++ debian/copyright 2014-08-01 04:53:22 +0000 |
58 | @@ -19,7 +19,29 @@ |
59 | . |
60 | On Debian systems, the complete text of the Apache License, Version 2 |
61 | can be found in "/usr/share/common-licenses/Apache-2.0". |
62 | - |
63 | + |
64 | +Files: gettext/* |
65 | +Copyright: 2012-2013 José Carlos Nieto |
66 | +License: MIT |
67 | + Permission is hereby granted, free of charge, to any person obtaining |
68 | + a copy of this software and associated documentation files (the |
69 | + "Software"), to deal in the Software without restriction, including |
70 | + without limitation the rights to use, copy, modify, merge, publish, |
71 | + distribute, sublicense, and/or sell copies of the Software, and to |
72 | + permit persons to whom the Software is furnished to do so, subject to |
73 | + the following conditions: |
74 | + . |
75 | + The above copyright notice and this permission notice shall be |
76 | + included in all copies or substantial portions of the Software. |
77 | + . |
78 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
79 | + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
80 | + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
81 | + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
82 | + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
83 | + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
84 | + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
85 | + |
86 | Files: * |
87 | Copyright: Copyright (C) 2013 Canonical, Ltd. |
88 | License: GPL-3 |
89 | |
90 | === modified file 'debian/rules' (properties changed: -x to +x) |
91 | --- debian/rules 2014-07-25 19:01:28 +0000 |
92 | +++ debian/rules 2014-08-01 04:53:22 +0000 |
93 | @@ -11,6 +11,7 @@ |
94 | dh $@ \ |
95 | --buildsystem=golang \ |
96 | --with=golang \ |
97 | + --with=translations \ |
98 | --fail-missing |
99 | |
100 | override_dh_auto_install: |
101 | |
102 | === added directory 'gettext' |
103 | === added file 'gettext/LICENSE' |
104 | --- gettext/LICENSE 1970-01-01 00:00:00 +0000 |
105 | +++ gettext/LICENSE 2014-08-01 04:53:22 +0000 |
106 | @@ -0,0 +1,20 @@ |
107 | +Copyright (c) 2012-2013 José Carlos Nieto, http://xiam.menteslibres.org/ |
108 | + |
109 | +Permission is hereby granted, free of charge, to any person obtaining |
110 | +a copy of this software and associated documentation files (the |
111 | +"Software"), to deal in the Software without restriction, including |
112 | +without limitation the rights to use, copy, modify, merge, publish, |
113 | +distribute, sublicense, and/or sell copies of the Software, and to |
114 | +permit persons to whom the Software is furnished to do so, subject to |
115 | +the following conditions: |
116 | + |
117 | +The above copyright notice and this permission notice shall be |
118 | +included in all copies or substantial portions of the Software. |
119 | + |
120 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
121 | +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
122 | +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
123 | +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
124 | +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
125 | +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
126 | +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
127 | |
128 | === added file 'gettext/README.md' |
129 | --- gettext/README.md 1970-01-01 00:00:00 +0000 |
130 | +++ gettext/README.md 2014-08-01 04:53:22 +0000 |
131 | @@ -0,0 +1,94 @@ |
132 | +# gosexy/gettext |
133 | + |
134 | +Go bindings for [GNU gettext][1], an internationalization and localization |
135 | +library for writing multilingual systems. |
136 | + |
137 | +## Requeriments |
138 | + |
139 | +The GNU C library. If you're using GNU/Linux, FreeBSD or OSX you should already |
140 | +have it. |
141 | + |
142 | +## Installation |
143 | + |
144 | +Use `go get` to download and install the binding: |
145 | + |
146 | +```sh |
147 | +go get github.com/gosexy/gettext |
148 | +``` |
149 | + |
150 | +## Usage |
151 | + |
152 | +```go |
153 | +package main |
154 | + |
155 | +import ( |
156 | + "github.com/gosexy/gettext" |
157 | + "fmt" |
158 | + "os" |
159 | +) |
160 | + |
161 | +func main() { |
162 | + gettext.BindTextdomain("example", ".") |
163 | + gettext.Textdomain("example") |
164 | + |
165 | + os.Setenv("LANGUAGE", "es_MX.utf8") |
166 | + |
167 | + gettext.SetLocale(gettext.LC_ALL, "") |
168 | + |
169 | + fmt.Println(gettext.Gettext("Hello, world!")) |
170 | +} |
171 | +``` |
172 | + |
173 | +You can use `os.Setenv` to set the `LANGUAGE` environment variable or set it |
174 | +on a terminal: |
175 | + |
176 | +```sh |
177 | +export LANGUAGE="es_MX.utf8" |
178 | +./gettext-program |
179 | +``` |
180 | + |
181 | +Note that `xgettext` does not officially support Go syntax yet, however, you |
182 | +can generate a valid `.pot` file by forcing `xgettest` to use the C++ |
183 | +syntax: |
184 | + |
185 | +```sh |
186 | +xgettext -d example -s gettext_test.go -o example.pot -L c++ -i \ |
187 | +--keyword=NGettext:1,2 --keyword=Gettext |
188 | +``` |
189 | + |
190 | +This will generate a `example.pot` file. |
191 | + |
192 | +After translating the `.pot` file, you must generate `.po` and `.mo` files and |
193 | +remember to set the UTF-8 charset. |
194 | + |
195 | +```sh |
196 | +msginit -l es_MX -o example.po -i example.pot |
197 | +msgfmt -c -v -o example.mo example.po |
198 | +``` |
199 | + |
200 | +Finally, move the `.mo` file to an appropriate location. |
201 | + |
202 | +```sh |
203 | +mv example.mo examples/es_MX.utf8/LC_MESSAGES/example.mo |
204 | +``` |
205 | + |
206 | +## Documentation |
207 | + |
208 | +You can read `gosexy/gettext` documentation from a terminal |
209 | + |
210 | +```sh |
211 | +go doc github.com/gosexy/gettext |
212 | +``` |
213 | + |
214 | +Or you can [browse it](http://godoc.org/github.com/gosexy/gettext) online. |
215 | + |
216 | +The original gettext documentation could be very useful as well: |
217 | + |
218 | +```sh |
219 | +man 3 gettext |
220 | +``` |
221 | + |
222 | +Here's another [good tutorial][2] on using gettext. |
223 | + |
224 | +[1]: http://www.gnu.org/software/gettext/ |
225 | +[2]: http://oriya.sarovar.org/docs/gettext_single.html |
226 | |
227 | === added file 'gettext/gettext.go' |
228 | --- gettext/gettext.go 1970-01-01 00:00:00 +0000 |
229 | +++ gettext/gettext.go 2014-08-01 04:53:22 +0000 |
230 | @@ -0,0 +1,207 @@ |
231 | +/* |
232 | + Copyright (c) 2012 José Carlos Nieto, http://xiam.menteslibres.org/ |
233 | + |
234 | + Permission is hereby granted, free of charge, to any person obtaining |
235 | + a copy of this software and associated documentation files (the |
236 | + "Software"), to deal in the Software without restriction, including |
237 | + without limitation the rights to use, copy, modify, merge, publish, |
238 | + distribute, sublicense, and/or sell copies of the Software, and to |
239 | + permit persons to whom the Software is furnished to do so, subject to |
240 | + the following conditions: |
241 | + |
242 | + The above copyright notice and this permission notice shall be |
243 | + included in all copies or substantial portions of the Software. |
244 | + |
245 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
246 | + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
247 | + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
248 | + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
249 | + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
250 | + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
251 | + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
252 | +*/ |
253 | + |
254 | +package gettext |
255 | + |
256 | +/* |
257 | + |
258 | +#include <libintl.h> |
259 | +#include <locale.h> |
260 | +#include <stdlib.h> |
261 | +*/ |
262 | +import "C" |
263 | + |
264 | +import ( |
265 | + "fmt" |
266 | + "strings" |
267 | + "unsafe" |
268 | +) |
269 | + |
270 | +var ( |
271 | + // For all of the locale. |
272 | + LC_ALL = uint(C.LC_ALL) |
273 | + |
274 | + // For regular expression matching (it determines the meaning of range |
275 | + // expressions and equivalence classes) and string collation. |
276 | + LC_COLATE = uint(C.LC_ALL) |
277 | + |
278 | + // For regular expression matching, character classification, conversion, |
279 | + // case-sensitive comparison, and wide character functions. |
280 | + LC_CTYPE = uint(C.LC_CTYPE) |
281 | + |
282 | + // For localizable natural-language messages. |
283 | + LC_MESSAGES = uint(C.LC_MESSAGES) |
284 | + |
285 | + // For monetary formatting. |
286 | + LC_MONETARY = uint(C.LC_MONETARY) |
287 | + |
288 | + // For number formatting (such as the decimal point and the thousands |
289 | + // separator). |
290 | + LC_NUMERIC = uint(C.LC_NUMERIC) |
291 | + |
292 | + // For time and date formatting. |
293 | + LC_TIME = uint(C.LC_TIME) |
294 | +) |
295 | + |
296 | +// Sets or queries the program's current locale. |
297 | +func SetLocale(category uint, locale string) string { |
298 | + clocale := C.CString(locale) |
299 | + |
300 | + res := C.GoString(C.setlocale(C.int(category), clocale)) |
301 | + |
302 | + C.free(unsafe.Pointer(clocale)) |
303 | + return res |
304 | +} |
305 | + |
306 | +// Sets directory containing message catalogs. |
307 | +func BindTextdomain(domainname string, dirname string) string { |
308 | + cdirname := C.CString(dirname) |
309 | + cdomainname := C.CString(domainname) |
310 | + |
311 | + res := C.GoString(C.bindtextdomain(cdomainname, cdirname)) |
312 | + |
313 | + C.free(unsafe.Pointer(cdirname)) |
314 | + C.free(unsafe.Pointer(cdomainname)) |
315 | + return res |
316 | +} |
317 | + |
318 | +// Sets the output codeset for message catalogs for domain domainname. |
319 | +func BindTextdomainCodeset(domainname string, codeset string) string { |
320 | + cdomainname := C.CString(domainname) |
321 | + ccodeset := C.CString(codeset) |
322 | + |
323 | + res := C.GoString(C.bind_textdomain_codeset(cdomainname, ccodeset)) |
324 | + |
325 | + C.free(unsafe.Pointer(cdomainname)) |
326 | + C.free(unsafe.Pointer(ccodeset)) |
327 | + return res |
328 | +} |
329 | + |
330 | +// Sets or retrieves the current message domain. |
331 | +func Textdomain(domainname string) string { |
332 | + cdomainname := C.CString(domainname) |
333 | + |
334 | + res := C.GoString(C.textdomain(cdomainname)) |
335 | + |
336 | + C.free(unsafe.Pointer(cdomainname)) |
337 | + return res |
338 | +} |
339 | + |
340 | +// Attempt to translate a text string into the user's native language, by |
341 | +// looking up the translation in a message catalog. |
342 | +func Gettext(msgid string) string { |
343 | + cmsgid := C.CString(msgid) |
344 | + |
345 | + res := C.GoString(C.gettext(cmsgid)) |
346 | + |
347 | + C.free(unsafe.Pointer(cmsgid)) |
348 | + return res |
349 | +} |
350 | + |
351 | +// Like Gettext(), but looking up the message in the specified domain. |
352 | +func DGettext(domain string, msgid string) string { |
353 | + cdomain := C.CString(domain) |
354 | + cmsgid := C.CString(msgid) |
355 | + |
356 | + res := C.GoString(C.dgettext(cdomain, cmsgid)) |
357 | + |
358 | + C.free(unsafe.Pointer(cdomain)) |
359 | + C.free(unsafe.Pointer(cmsgid)) |
360 | + return res |
361 | +} |
362 | + |
363 | +// Like Gettext(), but looking up the message in the specified domain and |
364 | +// category. |
365 | +func DCGettext(domain string, msgid string, category uint) string { |
366 | + cdomain := C.CString(domain) |
367 | + cmsgid := C.CString(msgid) |
368 | + |
369 | + res := C.GoString(C.dcgettext(cdomain, cmsgid, C.int(category))) |
370 | + |
371 | + C.free(unsafe.Pointer(cdomain)) |
372 | + C.free(unsafe.Pointer(cmsgid)) |
373 | + return res |
374 | +} |
375 | + |
376 | +// Attempt to translate a text string into the user's native language, by |
377 | +// looking up the appropriate plural form of the translation in a message |
378 | +// catalog. |
379 | +func NGettext(msgid string, msgid_plural string, n uint64) string { |
380 | + cmsgid := C.CString(msgid) |
381 | + cmsgid_plural := C.CString(msgid_plural) |
382 | + |
383 | + res := C.GoString(C.ngettext(cmsgid, cmsgid_plural, C.ulong(n))) |
384 | + |
385 | + C.free(unsafe.Pointer(cmsgid)) |
386 | + C.free(unsafe.Pointer(cmsgid_plural)) |
387 | + |
388 | + return res |
389 | +} |
390 | + |
391 | +// Like fmt.Sprintf() but without %!(EXTRA) errors. |
392 | +func Sprintf(format string, a ...interface{}) string { |
393 | + expects := strings.Count(format, "%") - strings.Count(format, "%%") |
394 | + |
395 | + if expects > 0 { |
396 | + arguments := make([]interface{}, expects) |
397 | + for i := 0; i < expects; i++ { |
398 | + if len(a) > i { |
399 | + arguments[i] = a[i] |
400 | + } |
401 | + } |
402 | + return fmt.Sprintf(format, arguments...) |
403 | + } |
404 | + |
405 | + return format |
406 | +} |
407 | + |
408 | +// Like NGettext(), but looking up the message in the specified domain. |
409 | +func DNGettext(domainname string, msgid string, msgid_plural string, n uint64) string { |
410 | + cdomainname := C.CString(domainname) |
411 | + cmsgid := C.CString(msgid) |
412 | + cmsgid_plural := C.CString(msgid_plural) |
413 | + |
414 | + res := C.GoString(C.dngettext(cdomainname, cmsgid, cmsgid_plural, C.ulong(n))) |
415 | + |
416 | + C.free(unsafe.Pointer(cdomainname)) |
417 | + C.free(unsafe.Pointer(cmsgid)) |
418 | + C.free(unsafe.Pointer(cmsgid_plural)) |
419 | + |
420 | + return res |
421 | +} |
422 | + |
423 | +// Like NGettext(), but looking up the message in the specified domain and |
424 | +// category. |
425 | +func DCNGettext(domainname string, msgid string, msgid_plural string, n uint64, category uint) string { |
426 | + cdomainname := C.CString(domainname) |
427 | + cmsgid := C.CString(msgid) |
428 | + cmsgid_plural := C.CString(msgid_plural) |
429 | + |
430 | + res := C.GoString(C.dcngettext(cdomainname, cmsgid, cmsgid_plural, C.ulong(n), C.int(category))) |
431 | + |
432 | + C.free(unsafe.Pointer(cdomainname)) |
433 | + C.free(unsafe.Pointer(cmsgid)) |
434 | + C.free(unsafe.Pointer(cmsgid_plural)) |
435 | + |
436 | + return res |
437 | +} |
438 | |
439 | === modified file 'plugins/gmail/gmail.go' |
440 | --- plugins/gmail/gmail.go 2014-07-29 11:45:57 +0000 |
441 | +++ plugins/gmail/gmail.go 2014-08-01 04:53:22 +0000 |
442 | @@ -21,11 +21,13 @@ |
443 | "encoding/json" |
444 | "fmt" |
445 | "net/http" |
446 | + "net/mail" |
447 | "net/url" |
448 | "os" |
449 | "sort" |
450 | |
451 | "launchpad.net/account-polld/accounts" |
452 | + "launchpad.net/account-polld/gettext" |
453 | "launchpad.net/account-polld/plugins" |
454 | ) |
455 | |
456 | @@ -90,12 +92,25 @@ |
457 | |
458 | for _, msg := range messages { |
459 | hdr := msg.Payload.mapHeaders() |
460 | + |
461 | + from := hdr[hdrFROM] |
462 | + if emailAddress, err := mail.ParseAddress(hdr[hdrFROM]); err != nil { |
463 | + if emailAddress.Name != "" { |
464 | + from = emailAddress.Name |
465 | + } |
466 | + } |
467 | + |
468 | if _, ok := pushMsgMap[msg.ThreadId]; ok { |
469 | - pushMsgMap[msg.ThreadId].Notification.Card.Summary += fmt.Sprintf(", %s", hdr[hdrFROM]) |
470 | + pushMsgMap[msg.ThreadId].Notification.Card.Summary += fmt.Sprintf(", %s", from) |
471 | } else { |
472 | - summary := fmt.Sprintf("Message \"%s\" from %s", hdr[hdrSUBJECT], hdr[hdrFROM]) |
473 | + summary := fmt.Sprintf(gettext.Gettext("%s"), hdr[hdrSUBJECT], from) |
474 | + body := fmt.Sprintf(gettext.Gettext("%s\n%s"), hdr[hdrSUBJECT], msg.Snippet) |
475 | action := "https://mail.google.com/mail/u/0/?pli=1#inbox/" + msg.ThreadId |
476 | +<<<<<<< TREE |
477 | pushMsgMap[msg.ThreadId] = *plugins.NewStandardPushMessage(summary, msg.Snippet, action, "") |
478 | +======= |
479 | + pushMsgMap[msg.ThreadId] = *plugins.NewStandardPushMessage(summary, body, action, gmailIcon) |
480 | +>>>>>>> MERGE-SOURCE |
481 | } |
482 | } |
483 | var pushMsg []plugins.PushMessage |
484 | |
485 | === modified file 'plugins/twitter/twitter.go' |
486 | --- plugins/twitter/twitter.go 2014-07-29 11:45:57 +0000 |
487 | +++ plugins/twitter/twitter.go 2014-08-01 04:53:22 +0000 |
488 | @@ -26,6 +26,7 @@ |
489 | "strings" |
490 | |
491 | "launchpad.net/account-polld/accounts" |
492 | + "launchpad.net/account-polld/gettext" |
493 | "launchpad.net/account-polld/plugins" |
494 | "launchpad.net/account-polld/plugins/twitter/oauth" // "github.com/garyburd/go-oauth/oauth" |
495 | ) |
496 | @@ -105,7 +106,15 @@ |
497 | |
498 | pushMsg := []plugins.PushMessage{} |
499 | for _, s := range statuses { |
500 | +<<<<<<< TREE |
501 | summary := fmt.Sprintf("@%s mentioned you", s.User.ScreenName) |
502 | +======= |
503 | + icon, err := plugins.DownloadAvatar(pluginName, s.User.Image) |
504 | + if err != nil { |
505 | + icon = twitterIcon |
506 | + } |
507 | + summary := fmt.Sprintf(gettext.Gettext("%s. @%s"), s.User.Name, s.User.ScreenName) |
508 | +>>>>>>> MERGE-SOURCE |
509 | action := fmt.Sprintf("http://mobile.twitter.com/%s/statuses/%d", s.User.ScreenName, s.Id) |
510 | pushMsg = append(pushMsg, *plugins.NewStandardPushMessage(summary, s.Text, action, s.User.Image)) |
511 | if len(pushMsg) == maxIndividualStatuses { |
512 | @@ -116,10 +125,10 @@ |
513 | if len(statuses) > len(pushMsg) { |
514 | var screennames []string |
515 | for _, s := range statuses[consolidatedStatusIndexStart:] { |
516 | - screennames = append(screennames, s.User.ScreenName) |
517 | + screennames = append(screennames, "@"+s.User.ScreenName) |
518 | } |
519 | - summary := "Multiple more mentions" |
520 | - body := fmt.Sprintf("From %s", strings.Join(screennames, ", ")) |
521 | + summary := gettext.Gettext("Multiple more mentions") |
522 | + body := fmt.Sprintf(gettext.Gettext("From %s"), strings.Join(screennames, ", ")) |
523 | action := "http://mobile.twitter.com/i/connect" |
524 | pushMsg = append(pushMsg, *plugins.NewStandardPushMessage(summary, body, action, "")) |
525 | } |
526 | @@ -157,7 +166,15 @@ |
527 | |
528 | pushMsg := []plugins.PushMessage{} |
529 | for _, m := range dms { |
530 | +<<<<<<< TREE |
531 | summary := fmt.Sprintf("@%s sent you a DM", m.Sender.ScreenName) |
532 | +======= |
533 | + icon, err := plugins.DownloadAvatar(pluginName, m.Sender.Image) |
534 | + if err != nil { |
535 | + icon = twitterIcon |
536 | + } |
537 | + summary := fmt.Sprintf(gettext.Gettext("%s. @%s"), m.Sender.Name, m.Sender.ScreenName) |
538 | +>>>>>>> MERGE-SOURCE |
539 | action := fmt.Sprintf("http://mobile.twitter.com/%s/messages", m.Sender.ScreenName) |
540 | pushMsg = append(pushMsg, *plugins.NewStandardPushMessage(summary, m.Text, action, m.Sender.Image)) |
541 | if len(pushMsg) == maxIndividualDirectMessages { |
542 | @@ -168,10 +185,10 @@ |
543 | if len(dms) > len(pushMsg) { |
544 | var senders []string |
545 | for _, m := range dms[consolidatedDirectMessageIndexStart:] { |
546 | - senders = append(senders, m.Sender.ScreenName) |
547 | + senders = append(senders, "@"+m.Sender.ScreenName) |
548 | } |
549 | - summary := "Multiple direct messages available" |
550 | - body := fmt.Sprintf("From %s", strings.Join(senders, ", ")) |
551 | + summary := gettext.Gettext("Multiple direct messages available") |
552 | + body := fmt.Sprintf(gettext.Gettext("From %s"), strings.Join(senders, ", ")) |
553 | action := "http://mobile.twitter.com/messages" |
554 | pushMsg = append(pushMsg, *plugins.NewStandardPushMessage(summary, body, action, "")) |
555 | } |
556 | |
557 | === added directory 'po' |
558 | === added file 'po/account-polld.pot' |
559 | --- po/account-polld.pot 1970-01-01 00:00:00 +0000 |
560 | +++ po/account-polld.pot 2014-08-01 04:53:22 +0000 |
561 | @@ -0,0 +1,48 @@ |
562 | +# Account-polld translation data |
563 | +# Copyright (C) 2014 Canonical Ltd. |
564 | +# This file is distributed under the same license as the account-polld package. |
565 | +# |
566 | +#, fuzzy |
567 | +msgid "" |
568 | +msgstr "Project-Id-Version: PACKAGE VERSION\n" |
569 | + "Report-Msgid-Bugs-To: \n" |
570 | + "POT-Creation-Date: 2014-07-29 15:28-0300\n" |
571 | + "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
572 | + "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
573 | + "Language-Team: LANGUAGE <LL@li.org>\n" |
574 | + "Language: \n" |
575 | + "MIME-Version: 1.0\n" |
576 | + "Content-Type: text/plain; charset=UTF-8\n" |
577 | + "Content-Transfer-Encoding: 8bit\n" |
578 | + |
579 | +#: plugins/gmail/gmail.go:108 |
580 | +#, c-format |
581 | +msgid "%s" |
582 | +msgstr "" |
583 | + |
584 | +#. This is the email subject followed by the message snippet |
585 | +#: plugins/gmail/gmail.go:109 |
586 | +#, c-format |
587 | +msgid "%s\n%s" |
588 | +msgstr "" |
589 | + |
590 | +#. This is the twitter users Name followed by the username. |
591 | +#: plugins/twitter/twitter.go:118 |
592 | +#: plugins/twitter/twitter.go:174 |
593 | +#, c-format |
594 | +msgid "%s. @%s" |
595 | +msgstr "" |
596 | + |
597 | +#: plugins/twitter/twitter.go:131 |
598 | +msgid "Multiple more mentions" |
599 | +msgstr "" |
600 | + |
601 | +#. From followed by the list of twitter usernames. |
602 | +#: plugins/twitter/twitter.go:132 |
603 | +#: plugins/twitter/twitter.go:175 |
604 | +msgid "From %s" |
605 | +msgstr "" |
606 | + |
607 | +#: plugins/twitter/twitter.go:187 |
608 | +msgid "Multiple direct messages available" |
609 | +msgstr "" |
FAILED: Continuous integration, rev:43 jenkins. qa.ubuntu. com/job/ account- polld-ci/ 34/ jenkins. qa.ubuntu. com/job/ account- polld-utopic- amd64-ci/ 34/console jenkins. qa.ubuntu. com/job/ account- polld-utopic- armhf-ci/ 34/console jenkins. qa.ubuntu. com/job/ account- polld-utopic- i386-ci/ 34/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/account- polld-ci/ 34/rebuild
http://