Merge lp:~aacid/telephony-service/mark_metrics_for_extraction into lp:telephony-service

Proposed by Albert Astals Cid
Status: Merged
Approved by: Manuel de la Peña
Approved revision: 893
Merged at revision: 896
Proposed branch: lp:~aacid/telephony-service/mark_metrics_for_extraction
Merge into: lp:telephony-service
Prerequisite: lp:~aacid/telephony-service/update_pot
Diff against target: 127 lines (+55/-12)
3 files modified
indicator/metrics.cpp (+12/-10)
po/CMakeLists.txt (+1/-1)
po/telephony-service.pot (+42/-1)
To merge this branch: bzr merge lp:~aacid/telephony-service/mark_metrics_for_extraction
Reviewer Review Type Date Requested Status
Tiago Salem Herrmann (community) Approve
PS Jenkins bot continuous-integration Approve
Manuel de la Peña (community) Approve
David Planella Pending
Pete Woods Pending
Review via email: mp+230093@code.launchpad.net

Commit message

Mark User Metrics strings for translation and extract them so they can get translated

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
David Planella (dpm) wrote :

Is there a way we could use plural forms in strings such as these -> "<b>%1</b> calls made today"?

Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

Hi thanks for the patch, but I had a similar branch here: https://code.launchpad.net/~tiagosh/telephony-service/fix-18n-metrics

Revision history for this message
Albert Astals Cid (aacid) wrote :

Your patch is less good because it translates the string when sent to the database instead, which is not what has to be done according to the UserMetrics developers.

Revision history for this message
Albert Astals Cid (aacid) wrote :

David, you'll have to ask Pete Woods about that, my understanding is that not at the moment.

874. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

875. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

876. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

877. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

878. By Tiago Salem Herrmann

Use system settings to retrieve sim card display names.
Approved by: Gustavo Pichorim Boiko, PS Jenkins bot

879. By Martti Piirainen

Adding support for tone generator (LP: #1187453). Fixes: 1187453, 1228711
Approved by: Tiago Salem Herrmann

880. By Tiago Salem Herrmann

- Reduce vibration duration for text messages
- Fix vibration in silent mode options for calls/messages Fixes: 1347908
Approved by: Gustavo Pichorim Boiko, PS Jenkins bot

881. By Gustavo Pichorim Boiko

Check if the self contact actually exists before getting its presence. Fixes: 1355388
Approved by: Tiago Salem Herrmann

882. By Gustavo Pichorim Boiko

Do not update the .po files during `make`, update only the .pot file.
Approved by: Tiago Salem Herrmann

883. By PS Jenkins bot

Releasing 0.1+14.10.20140813.1-0ubuntu1

884. By PS Jenkins bot

Resync trunk

885. By Tiago Salem Herrmann

Fix USSDManager for multiple accounts

886. By PS Jenkins bot

Releasing 0.1+14.10.20140814-0ubuntu1

887. By PS Jenkins bot

Resync trunk

Revision history for this message
Leo Arias (elopio) wrote :

Hey Tiago. Your branch is not proposed to merge. Can we land this one?
I'll add Pete Woods as a reviewer to ask him about plurals.

888. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

889. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

890. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

891. By Albert Astals Cid

Update .pot file

892. By Albert Astals Cid

Mark User Metrics strings for translation and extract them so they can get translated

893. By Albert Astals Cid

Run make telephony-service.pot after extraction fixes

Revision history for this message
Manuel de la Peña (mandel) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

I am ok to land this too.
I will delete my old branch.
Thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'indicator/metrics.cpp'
2--- indicator/metrics.cpp 2013-09-26 18:20:05 +0000
3+++ indicator/metrics.cpp 2014-08-20 09:38:38 +0000
4@@ -30,6 +30,8 @@
5 const QString DIALER_OUTGOING_STATISTICS_ID = QString("dialer-calls-outgoing");
6 const QString DIALER_CALL_DURATION_STATISTICS_ID = QString("dialer-calls-duration");
7
8+#define GettextMarkExtraction(x) x
9+
10 using namespace UserMetricsInput;
11
12 Metrics::Metrics(QObject *parent) :
13@@ -37,16 +39,16 @@
14 {
15 try {
16 mMetricManager.reset(MetricManager::getInstance());
17- mMetrics[SentMessages] = mMetricManager->add(MetricParameters(MESSAGES_SENT_STATISTICS_ID).formatString("<b>%1</b> text messages sent today")
18- .emptyDataString("No text messages sent today").textDomain(APP_ID).minimum(0.0));
19- mMetrics[ReceivedMessages] = mMetricManager->add(MetricParameters(MESSAGES_RECEIVED_STATISTICS_ID).formatString("<b>%1</b> text messages received today")
20- .emptyDataString("No text messages received today").textDomain(APP_ID).minimum(0.0));
21- mMetrics[IncomingCalls] = mMetricManager->add(MetricParameters(DIALER_INCOMING_STATISTICS_ID).formatString("<b>%1</b> calls received today")
22- .emptyDataString("No calls received today").textDomain(APP_ID).minimum(0.0));
23- mMetrics[OutgoingCalls] = mMetricManager->add(MetricParameters(DIALER_OUTGOING_STATISTICS_ID).formatString("<b>%1</b> calls made today")
24- .emptyDataString("No calls made today").textDomain(APP_ID).minimum(0.0));
25- mMetrics[CallDurations] = mMetricManager->add(MetricParameters(DIALER_CALL_DURATION_STATISTICS_ID).formatString("Spent <b>%1</b> minutes in calls today")
26- .emptyDataString("No calls made today").textDomain(APP_ID).minimum(0.0));
27+ mMetrics[SentMessages] = mMetricManager->add(MetricParameters(MESSAGES_SENT_STATISTICS_ID).formatString(GettextMarkExtraction("<b>%1</b> text messages sent today"))
28+ .emptyDataString(GettextMarkExtraction("No text messages sent today")).textDomain(APP_ID).minimum(0.0));
29+ mMetrics[ReceivedMessages] = mMetricManager->add(MetricParameters(MESSAGES_RECEIVED_STATISTICS_ID).formatString(GettextMarkExtraction("<b>%1</b> text messages received today"))
30+ .emptyDataString(GettextMarkExtraction("No text messages received today")).textDomain(APP_ID).minimum(0.0));
31+ mMetrics[IncomingCalls] = mMetricManager->add(MetricParameters(DIALER_INCOMING_STATISTICS_ID).formatString(GettextMarkExtraction("<b>%1</b> calls received today"))
32+ .emptyDataString(GettextMarkExtraction("No calls received today")).textDomain(APP_ID).minimum(0.0));
33+ mMetrics[OutgoingCalls] = mMetricManager->add(MetricParameters(DIALER_OUTGOING_STATISTICS_ID).formatString(GettextMarkExtraction("<b>%1</b> calls made today"))
34+ .emptyDataString(GettextMarkExtraction("No calls made today")).textDomain(APP_ID).minimum(0.0));
35+ mMetrics[CallDurations] = mMetricManager->add(MetricParameters(DIALER_CALL_DURATION_STATISTICS_ID).formatString(GettextMarkExtraction("Spent <b>%1</b> minutes in calls today"))
36+ .emptyDataString(GettextMarkExtraction("No calls made today")).textDomain(APP_ID).minimum(0.0));
37 } catch(std::exception &e) {
38 qWarning() << "Error connecting to metrics service:" << e.what();
39 }
40
41=== modified file 'po/CMakeLists.txt'
42--- po/CMakeLists.txt 2014-08-13 20:22:56 +0000
43+++ po/CMakeLists.txt 2014-08-20 09:38:38 +0000
44@@ -30,7 +30,7 @@
45 if(XGETTEXT_EXECUTABLE)
46 add_custom_target(${POT_FILE} ALL
47 COMMENT "Generating translation template"
48- COMMAND ${XGETTEXT_EXECUTABLE} --c++ --qt --add-comments=TRANSLATORS --keyword=tr --keyword=tr:1,2 -D ${CMAKE_SOURCE_DIR} -s -p ${CMAKE_CURRENT_SOURCE_DIR} -o ${POT_FILE} ${I18N_SRCS}
49+ COMMAND ${XGETTEXT_EXECUTABLE} --c++ --qt --add-comments=TRANSLATORS --keyword=GettextMarkExtraction --keyword=tr --keyword=tr:1,2 -D ${CMAKE_SOURCE_DIR} -s -p ${CMAKE_CURRENT_SOURCE_DIR} -o ${POT_FILE} ${I18N_SRCS}
50 )
51
52 add_custom_target(translations
53
54=== modified file 'po/telephony-service.pot'
55--- po/telephony-service.pot 2014-08-20 09:38:38 +0000
56+++ po/telephony-service.pot 2014-08-20 09:38:38 +0000
57@@ -8,7 +8,7 @@
58 msgstr ""
59 "Project-Id-Version: PACKAGE VERSION\n"
60 "Report-Msgid-Bugs-To: \n"
61-"POT-Creation-Date: 2014-08-18 09:41+0200\n"
62+"POT-Creation-Date: 2014-08-20 11:37+0200\n"
63 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
64 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
65 "Language-Team: LANGUAGE <LL@li.org>\n"
66@@ -32,6 +32,26 @@
67 msgstr[0] ""
68 msgstr[1] ""
69
70+#: indicator/metrics.cpp:48
71+#, qt-format
72+msgid "<b>%1</b> calls made today"
73+msgstr ""
74+
75+#: indicator/metrics.cpp:46
76+#, qt-format
77+msgid "<b>%1</b> calls received today"
78+msgstr ""
79+
80+#: indicator/metrics.cpp:44
81+#, qt-format
82+msgid "<b>%1</b> text messages received today"
83+msgstr ""
84+
85+#: indicator/metrics.cpp:42
86+#, qt-format
87+msgid "<b>%1</b> text messages sent today"
88+msgstr ""
89+
90 #: approver/approver.cpp:292
91 msgid "Accept"
92 msgstr ""
93@@ -86,6 +106,22 @@
94 msgid "Message from %1"
95 msgstr ""
96
97+#: indicator/metrics.cpp:49 indicator/metrics.cpp:51
98+msgid "No calls made today"
99+msgstr ""
100+
101+#: indicator/metrics.cpp:47
102+msgid "No calls received today"
103+msgstr ""
104+
105+#: indicator/metrics.cpp:45
106+msgid "No text messages received today"
107+msgstr ""
108+
109+#: indicator/metrics.cpp:43
110+msgid "No text messages sent today"
111+msgstr ""
112+
113 #: indicator/textchannelobserver.cpp:169 indicator/ussdindicator.cpp:79
114 msgid "Ok"
115 msgstr ""
116@@ -123,6 +159,11 @@
117 msgid "Sorry, I'm still busy. I'll call you later."
118 msgstr ""
119
120+#: indicator/metrics.cpp:50
121+#, qt-format
122+msgid "Spent <b>%1</b> minutes in calls today"
123+msgstr ""
124+
125 #: indicator/messagingmenu.cpp:55 indicator/messagingmenu.cpp:59
126 msgid "Telephony Service"
127 msgstr ""

Subscribers

People subscribed via source and target branches