Merge lp:~nik90/ubuntu-clock-app/make-alarmlabel-translatable into lp:ubuntu-clock-app

Proposed by Nekhelesh Ramananthan
Status: Merged
Approved by: Nekhelesh Ramananthan
Approved revision: 93
Merged at revision: 91
Proposed branch: lp:~nik90/ubuntu-clock-app/make-alarmlabel-translatable
Merge into: lp:ubuntu-clock-app
Diff against target: 206 lines (+49/-24)
3 files modified
app/alarm/EditAlarmPage.qml (+11/-0)
debian/changelog (+1/-0)
po/com.ubuntu.clock.pot (+37/-24)
To merge this branch: bzr merge lp:~nik90/ubuntu-clock-app/make-alarmlabel-translatable
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
David Planella Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Ubuntu Clock Developers Pending
Review via email: mp+233828@code.launchpad.net

Commit message

Made the default alarm label translatable and updated the pot file.

Description of the change

Made the default alarm label translatable and updated the pot file.

==== Checklist ====

* Are there any related MPs required for this MP to build/function as expected? Please list.

None Required.

* Is your branch in sync with latest trunk? (e.g. bzr pull lp:ubuntu-clock-app -> no changes)

Yes it is.

* Did the tests run successfully (QML and AP)?

Yes

* Did you perform an exploratory manual test run of your code change and any related functionality?

Yes

* What device (or emulator) has your component test plan been executed successfully on?

x86 Emulator and N4 Device

* If you changed the UI, was the change specified/approved by design?

No UI Change

* What manual tests are relevant for this MP?

- Change your phone language to something other than english.
- Create a new alarm
- In the add alarm page, ensure that the alarm label is translated

* If you changed UI labels, did you update the pot file?

Yes, I updated the pot file

* Did you include a link to the MR Review Checklist Template to make your reviewer's life easier?

https://wiki.ubuntu.com/Process/Merges/Checklists/Clock

To post a comment you must log in.
93. By Nekhelesh Ramananthan

Commented code to make it more clear to other devs

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
David Planella (dpm) wrote :

Looks good to me. However, I've noticed some updates in the .pot file that probably need to be fixed in a separate branch:

186 -msgid "%1 h %2 m %3"
187 +msgid "%1h %2m %3"
188 msgstr ""
189
190 #. TRANSLATORS: the first argument is hour, followed by the
191 #. translation for either 'behind' or 'ahead'
192 #: ../app/worldclock/UserWorldCityDelegate.qml:160
193 #, qt-format
194 -msgid "%1 h %2"
195 +msgid "%1h %2"
196 msgstr ""
197
198 #. TRANSLATORS: the first argument is minute, followed by the
199 #. translation for either 'behind' or 'ahead'
200 #: ../app/worldclock/UserWorldCityDelegate.qml:168
201 #, qt-format
202 -msgid "%1 m %2"
203 +msgid "%1m %2"

Numerical value and unit symbol are separated by a space (see [1]), which seems to have been reverted in a previous branch. This is not just about being pedantic: attaching letters to %1 arguments modifies the way the arguments behave, therefore it's always best to leave the %1 args on their own. As an example, if I try to translate this string in LP: "%1m %2" as "%1 m %2", gettext complains that the translated argument needs to be the same as the original, and does not allow me to submit the translation.

So approving it, but with caveats for this to be changed in a separate branch.

[1] http://en.wikipedia.org/wiki/ISO_31-0

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/alarm/EditAlarmPage.qml'
2--- app/alarm/EditAlarmPage.qml 2014-09-01 11:59:43 +0000
3+++ app/alarm/EditAlarmPage.qml 2014-09-08 22:31:21 +0000
4@@ -173,6 +173,17 @@
5 Alarm {
6 id: _alarm
7
8+ Component.onCompleted: {
9+ /*
10+ Sets the alarm name manually to "Alarm" to ensure that it is
11+ translatable instead of using the default name set by the SDK
12+ Alarms API.
13+ */
14+ if (isNewAlarm) {
15+ _alarm.message = i18n.tr("Alarm")
16+ }
17+ }
18+
19 onErrorChanged: {
20 if (error !== Alarm.NoError) {
21 Utils.log(debugMode, "Error saving alarm, code: " + error)
22
23=== modified file 'debian/changelog'
24--- debian/changelog 2014-09-06 16:34:39 +0000
25+++ debian/changelog 2014-09-08 22:31:21 +0000
26@@ -30,6 +30,7 @@
27 * Fixed no UI hint being show to add cities (LP: #1362263)
28 * Fixed add world city being triggered accidentally (LP: #1359180)
29 * Added alarm snooze settings (LP: #1354400)
30+ * Fixed default alarm label not being translatable (LP: #1365012)
31
32 [Zsombor Egri]
33 * Fixed alarm status toggle being reverted immediately (LP: #1272337)
34
35=== modified file 'po/com.ubuntu.clock.pot'
36--- po/com.ubuntu.clock.pot 2014-09-04 21:12:53 +0000
37+++ po/com.ubuntu.clock.pot 2014-09-08 22:31:21 +0000
38@@ -8,7 +8,7 @@
39 msgstr ""
40 "Project-Id-Version: \n"
41 "Report-Msgid-Bugs-To: \n"
42-"POT-Creation-Date: 2014-09-02 17:11+0200\n"
43+"POT-Creation-Date: 2014-09-09 00:21+0200\n"
44 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
45 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
46 "Language-Team: LANGUAGE <LL@li.org>\n"
47@@ -17,23 +17,23 @@
48 "Content-Type: text/plain; charset=CHARSET\n"
49 "Content-Transfer-Encoding: 8bit\n"
50
51-#: ../app/alarm/AlarmDelegate.qml:135
52+#: ../app/alarm/AlarmDelegate.qml:136
53 #, qt-format
54 msgid "in %1d %1h %2m"
55 msgstr ""
56
57-#: ../app/alarm/AlarmDelegate.qml:144
58+#: ../app/alarm/AlarmDelegate.qml:145
59 #, qt-format
60 msgid "in %1h %2m"
61 msgstr ""
62
63-#: ../app/alarm/AlarmDelegate.qml:152
64+#: ../app/alarm/AlarmDelegate.qml:153
65 #, c-format, qt-format
66 msgid "in %1m"
67 msgstr ""
68
69 #: ../app/alarm/AlarmLabel.qml:30 ../app/alarm/AlarmLabel.qml:52
70-#: ../app/alarm/EditAlarmPage.qml:268
71+#: ../app/alarm/EditAlarmPage.qml:303
72 msgid "Label"
73 msgstr ""
74
75@@ -46,7 +46,8 @@
76 msgid "Alarms"
77 msgstr ""
78
79-#: ../app/alarm/AlarmPage.qml:42 ../app/alarm/EditAlarmPage.qml:54
80+#: ../app/alarm/AlarmPage.qml:42 ../app/alarm/EditAlarmPage.qml:55
81+#: ../app/alarm/EditAlarmPage.qml:178
82 msgid "Alarm"
83 msgstr ""
84
85@@ -54,11 +55,11 @@
86 msgid "Cancel selection"
87 msgstr ""
88
89-#: ../app/alarm/AlarmPage.qml:64
90+#: ../app/alarm/AlarmPage.qml:64 ../app/alarm/AlarmRepeat.qml:35
91 msgid "Select All"
92 msgstr ""
93
94-#: ../app/alarm/AlarmRepeat.qml:28 ../app/alarm/EditAlarmPage.qml:258
95+#: ../app/alarm/AlarmRepeat.qml:31 ../app/alarm/EditAlarmPage.qml:293
96 msgid "Repeat"
97 msgstr ""
98
99@@ -66,9 +67,12 @@
100 msgid "Settings"
101 msgstr ""
102
103-#: ../app/alarm/AlarmSettingsPage.qml:70 ../app/alarm/AlarmSettingsPage.qml:71
104-#: ../app/alarm/AlarmSettingsPage.qml:72 ../app/alarm/AlarmSettingsPage.qml:73
105-#: ../app/alarm/AlarmSettingsPage.qml:136
106+#: ../app/alarm/AlarmSettingsPage.qml:53 ../app/alarm/AlarmSettingsPage.qml:54
107+#: ../app/alarm/AlarmSettingsPage.qml:55 ../app/alarm/AlarmSettingsPage.qml:56
108+#: ../app/alarm/AlarmSettingsPage.qml:65 ../app/alarm/AlarmSettingsPage.qml:66
109+#: ../app/alarm/AlarmSettingsPage.qml:67 ../app/alarm/AlarmSettingsPage.qml:68
110+#: ../app/alarm/AlarmSettingsPage.qml:135
111+#: ../app/alarm/AlarmSettingsPage.qml:198
112 #, qt-format
113 msgid "%1 minutes"
114 msgstr ""
115@@ -77,31 +81,39 @@
116 msgid "Alarm volume"
117 msgstr ""
118
119-#: ../app/alarm/AlarmSettingsPage.qml:135
120+#: ../app/alarm/AlarmSettingsPage.qml:134
121 msgid "Silence after"
122 msgstr ""
123
124-#: ../app/alarm/AlarmSettingsPage.qml:177
125+#: ../app/alarm/AlarmSettingsPage.qml:197
126+msgid "Snooze for"
127+msgstr ""
128+
129+#: ../app/alarm/AlarmSettingsPage.qml:241
130 msgid "Vibration"
131 msgstr ""
132
133-#: ../app/alarm/AlarmSettingsPage.qml:206
134+#: ../app/alarm/AlarmSettingsPage.qml:270
135 msgid "Change time and date"
136 msgstr ""
137
138-#: ../app/alarm/AlarmSound.qml:27 ../app/alarm/EditAlarmPage.qml:281
139+#: ../app/alarm/AlarmSound.qml:27 ../app/alarm/EditAlarmPage.qml:316
140 msgid "Sound"
141 msgstr ""
142
143-#: ../app/alarm/AlarmUtils.qml:33
144+#: ../app/alarm/AlarmUtils.qml:31
145+msgid "Never"
146+msgstr ""
147+
148+#: ../app/alarm/AlarmUtils.qml:37
149 msgid "Weekdays"
150 msgstr ""
151
152-#: ../app/alarm/AlarmUtils.qml:37
153+#: ../app/alarm/AlarmUtils.qml:41
154 msgid "Weekends"
155 msgstr ""
156
157-#: ../app/alarm/AlarmUtils.qml:41
158+#: ../app/alarm/AlarmUtils.qml:45
159 msgid "Daily"
160 msgstr ""
161
162@@ -113,15 +125,16 @@
163 msgid "Edit alarm"
164 msgstr ""
165
166-#: ../app/alarm/EditAlarmPage.qml:305
167+#: ../app/alarm/EditAlarmPage.qml:340
168 msgid "Delete alarm"
169 msgstr ""
170
171-#: ../app/clock/ClockPage.qml:64
172+#: ../app/worldclock/AddWorldCityButton.qml:36
173 msgid "Add"
174 msgstr ""
175
176-#: ../app/clock/ClockPage.qml:65 ../app/worldclock/WorldCityList.qml:52
177+#: ../app/worldclock/AddWorldCityButton.qml:62
178+#: ../app/worldclock/WorldCityList.qml:52
179 msgid "City"
180 msgstr ""
181
182@@ -140,21 +153,21 @@
183 #. 'ahead'
184 #: ../app/worldclock/UserWorldCityDelegate.qml:151
185 #, qt-format
186-msgid "%1 h %2 m %3"
187+msgid "%1h %2m %3"
188 msgstr ""
189
190 #. TRANSLATORS: the first argument is hour, followed by the
191 #. translation for either 'behind' or 'ahead'
192 #: ../app/worldclock/UserWorldCityDelegate.qml:160
193 #, qt-format
194-msgid "%1 h %2"
195+msgid "%1h %2"
196 msgstr ""
197
198 #. TRANSLATORS: the first argument is minute, followed by the
199 #. translation for either 'behind' or 'ahead'
200 #: ../app/worldclock/UserWorldCityDelegate.qml:168
201 #, qt-format
202-msgid "%1 m %2"
203+msgid "%1m %2"
204 msgstr ""
205
206 #: ../app/worldclock/UserWorldCityDelegate.qml:174

Subscribers

People subscribed via source and target branches