Merge lp:~vthompson/ubuntu-weather-app/fix-1290492-weather into lp:ubuntu-weather-app/obsolete.trunk

Proposed by Victor Thompson
Status: Merged
Approved by: David Planella
Approved revision: 223
Merged at revision: 223
Proposed branch: lp:~vthompson/ubuntu-weather-app/fix-1290492-weather
Merge into: lp:ubuntu-weather-app/obsolete.trunk
Diff against target: 345 lines (+95/-101)
5 files modified
CMakeLists.txt (+1/-0)
README.translations (+6/-6)
po/CMakeLists.txt (+1/-1)
po/com.ubuntu.weather.pot (+87/-36)
po/po.pro (+0/-58)
To merge this branch: bzr merge lp:~vthompson/ubuntu-weather-app/fix-1290492-weather
Reviewer Review Type Date Requested Status
David Planella Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+210326@code.launchpad.net

Commit message

* Fix po.pro file for desktop filename change
* Update translation strings

Description of the change

* Fix po.pro file for desktop filename change
* Update translation strings

To post a comment you must log in.
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 :

Thanks Victor. Note that it's not necessary to use the po.pro file anymore after the migration to cmake. See the updated README.translations file.

However, when I did that I forgot to actually remove the po/po.pro file. Would you mind using this MP to do the po.pro file removal instead of fixing it?

review: Needs Fixing
Revision history for this message
Victor Thompson (vthompson) wrote :

I'll do so tonight

221. By Victor Thompson

Simplified translation instructions to use click-buddy and fixed the app name

222. By Victor Thompson

remove po.pro

Revision history for this message
Victor Thompson (vthompson) wrote :

However we decide to simplify the build for the weather app and its translations, we'll use the same pattern for lp:1290814 to update the other apps.

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 :

Thanks a lot for updating the documentation with an easier way to generate the .pot file with click-buddy.

Looking at the generated .pot file in the diff I've noticed an issue:

62 +#: .build/com.ubuntu.weather_weather.desktop.in.in:1
63 +msgid "tr("
64 +msgstr ""
65 +
66 +#: com.ubuntu.weather_weather.desktop.in.in:7
67 +msgid "Weather"
68 +msgstr ""

I wasn't expecting the "tr(" to be extracted from the .desktop.in.in file. However, after trying both build methods (the original one in the README.translations file using cmake directly, and the new one using click-buddy), I could not reproduce this. I.e. I always ended up with a correct .pot file with no "tr(" string in it.

review: Needs Fixing
Revision history for this message
David Planella (dpm) wrote :

Looking at the path on:

62 +#: .build/com.ubuntu.weather_weather.desktop.in.in:1

It seems this comes from files created from a previous build, so cleaning up the local directory and resubmitting the branch should fix it.

As an additional thought, perhaps the cmake rule to find translatable files is too generic and should be more restrictive in defining which exact files should be I18N_SRC_FILES, rather than globbing for anything underneath the source dir? Note that'd make us less flexible in adding new files without having to explicitly list them as I18N_SRC_FILES, though.

file(GLOB_RECURSE I18N_SRC_FILES
     RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
     components/*.qml components/*.js ${DESKTOP_FILE}.in.in)
list(SORT I18N_SRC_FILES)

223. By Victor Thompson

Remove desktop file in .build from international files.

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
Victor Thompson (vthompson) wrote :

Please review again. The process update for the other apps [1] won't be done until this branch provides a framework.

[1] https://code.launchpad.net/bugs/1290814

Revision history for this message
David Planella (dpm) wrote :

Looks good to me now, thanks Victor!

One thing I've noticed, but this is not related to this change, is that xgettext does not honour the --package-name argument, so it is left at the default value. I've seen this happening in other software (non-QML, non-cmake), so I think it's rather an xgettext bug:

+ --package-name='${APP_HARDCODE}'

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-02-19 21:35:29 +0000
3+++ CMakeLists.txt 2014-03-12 11:47:38 +0000
4@@ -43,6 +43,7 @@
5 RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
6 components/*.qml components/*.js ${DESKTOP_FILE}.in.in)
7 list(SORT I18N_SRC_FILES)
8+list(REMOVE_ITEM I18N_SRC_FILES .build/${DESKTOP_FILE}.in.in)
9
10 file(GLOB SRC_FILES
11 RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
12
13=== modified file 'README.translations'
14--- README.translations 2014-02-14 09:52:57 +0000
15+++ README.translations 2014-03-12 11:47:38 +0000
16@@ -10,12 +10,12 @@
17 translatable messages to translators. So whenever you add new translatable
18 messages in the code, make sure to follow these steps:
19
20- 1. Create a build directory: `mkdir ../build && cd ../build`
21- 2. Run the cmake config: `cmake ../<original-branch>`
22- 3. Build the project to generate the updated .pot file: `make`
23- 4. Copy the .pot file to your original sources: `cp po/*.pot ../<original-branch>`
24- 5. Commit the generated .pot file: `bzr commit -m"Updated translation template"`
25- 6. Push the branch and send a merge proposal as usual
26+ 1. Run click-buddy retaining the build directory: `click-buddy --dir . --no-clean`
27+ 2. Copy the .pot file from the <build dir> mentioned in the output to your original
28+ source:
29+ `cp <build dir>/po/*.pot po/`
30+ 3. Commit the generated .pot file: `bzr commit -m"Updated translation template"`
31+ 4. Push the branch and send a merge proposal as usual
32
33 And that's it, once the branch lands Launchpad should take care of all the rest!
34
35
36=== modified file 'po/CMakeLists.txt'
37--- po/CMakeLists.txt 2014-02-14 09:52:57 +0000
38+++ po/CMakeLists.txt 2014-03-12 11:47:38 +0000
39@@ -13,7 +13,7 @@
40 --from-code=UTF-8
41 --c++ --qt --add-comments=TRANSLATORS
42 --keyword=tr --keyword=tr:1,2
43- --package-name='${PROJECT}'
44+ --package-name='${APP_HARDCODE}'
45 --copyright-holder='Canonical Ltd.'
46 ${I18N_SRC_FILES})
47
48
49=== modified file 'po/com.ubuntu.weather.pot'
50--- po/com.ubuntu.weather.pot 2014-02-14 09:52:57 +0000
51+++ po/com.ubuntu.weather.pot 2014-03-12 11:47:38 +0000
52@@ -1,5 +1,5 @@
53 # SOME DESCRIPTIVE TITLE.
54-# Copyright (C) YEAR Canonical Ltd.
55+# Copyright (C) YEAR Canonical Ltd.
56 # This file is distributed under the same license as the PACKAGE package.
57 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
58 #
59@@ -8,7 +8,7 @@
60 msgstr ""
61 "Project-Id-Version: ubuntu-weather-app\n"
62 "Report-Msgid-Bugs-To: \n"
63-"POT-Creation-Date: 2014-01-15 02:51+0330\n"
64+"POT-Creation-Date: 2014-03-12 06:45-0500\n"
65 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
66 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
67 "Language-Team: LANGUAGE <LL@li.org>\n"
68@@ -17,129 +17,180 @@
69 "Content-Type: text/plain; charset=CHARSET\n"
70 "Content-Transfer-Encoding: 8bit\n"
71
72-#: ../components/AddLocationSheet.qml:32
73-#: ../components/LocationManagerSheet.qml:268
74+#: com.ubuntu.weather_weather.desktop.in.in:7
75+msgid "Weather"
76+msgstr ""
77+
78+#: components/AddLocationSheet.qml:33 components/LocationManagerSheet.qml:300
79 msgid "Add city"
80 msgstr ""
81
82-#: ../components/AddLocationSheet.qml:70
83+#: components/AddLocationSheet.qml:76
84 #, qt-format
85 msgid "No location was found for %1"
86 msgstr ""
87
88-#: ../components/AddLocationSheet.qml:128
89+#: components/AddLocationSheet.qml:139
90 msgid "Enter a city name"
91 msgstr ""
92
93-#: ../components/CurrentWeather.qml:154
94+#: components/CurrentWeather.qml:62 components/CurrentWeatherDetail.qml:32
95+msgid "Chance of Snow"
96+msgstr ""
97+
98+#: components/CurrentWeather.qml:62 components/CurrentWeatherDetail.qml:32
99+msgid "Chance of Rain"
100+msgstr ""
101+
102+#: components/CurrentWeather.qml:69 components/CurrentWeatherDetail.qml:39
103+msgid "Low"
104+msgstr ""
105+
106+#: components/CurrentWeather.qml:71 components/CurrentWeatherDetail.qml:41
107+msgid "Moderate"
108+msgstr ""
109+
110+#: components/CurrentWeather.qml:73 components/CurrentWeatherDetail.qml:43
111+msgid "High"
112+msgstr ""
113+
114+#: components/CurrentWeather.qml:75 components/CurrentWeatherDetail.qml:45
115+msgid "Very high"
116+msgstr ""
117+
118+#: components/CurrentWeather.qml:77 components/CurrentWeatherDetail.qml:47
119+msgid "Extreme"
120+msgstr ""
121+
122+#: components/CurrentWeatherDetail.qml:69
123 msgid "Humidity"
124 msgstr ""
125
126-#: ../components/CurrentWeather.qml:170
127+#: components/CurrentWeatherDetail.qml:85
128 msgid "Wind speed"
129 msgstr ""
130
131-#: ../components/CurrentWeather.qml:195
132+#: components/CurrentWeatherDetail.qml:100
133 msgid "Pressure"
134 msgstr ""
135
136-#: ../components/CurrentWeather.qml:196
137+#: components/CurrentWeatherDetail.qml:101
138+msgid "Percent"
139+msgstr ""
140+
141+#: components/CurrentWeatherDetail.qml:101
142 msgid "mbar"
143 msgstr ""
144
145-#: ../components/CurrentWeather.qml:211
146+#: components/CurrentWeatherDetail.qml:116
147+msgid "UV index"
148+msgstr ""
149+
150+#: components/CurrentWeatherDetail.qml:116
151 msgid "Precipitation"
152 msgstr ""
153
154-#: ../components/LastUpdatedComponent.qml:33
155+#: components/LastUpdatedComponent.qml:35
156 msgid "Updated: "
157 msgstr ""
158
159-#: ../components/LastUpdatedComponent.qml:37
160+#: components/LastUpdatedComponent.qml:39
161 msgid "Today, "
162 msgstr ""
163
164-#: ../components/LoadingSpinnerComponent.qml:44
165+#: components/LoadingSpinnerComponent.qml:44
166 msgid "Loading..."
167 msgstr ""
168
169-#: ../components/LocationManagerSheet.qml:32
170+#: components/LocationManagerSheet.qml:33
171 msgid "Edit locations"
172 msgstr ""
173
174-#: ../components/LocationManagerSheet.qml:104
175+#: components/LocationManagerSheet.qml:120
176 msgid "Current location"
177 msgstr ""
178
179-#: ../components/LocationManagerSheet.qml:124
180+#: components/LocationManagerSheet.qml:143
181 msgid "Scan for location"
182 msgstr ""
183
184 #. TRANSLATORS: this is the button to add a location (city) that has been
185 #. detected to be the current position
186-#: ../components/LocationManagerSheet.qml:187
187+#: components/LocationManagerSheet.qml:208
188 msgid "Add"
189 msgstr ""
190
191-#: ../components/LocationManagerSheet.qml:204
192+#: components/LocationManagerSheet.qml:228
193 msgid "World"
194 msgstr ""
195
196-#: ../components/LocationManagerSheet.qml:286
197+#: components/LocationManagerSheet.qml:318
198 msgid "Location already added."
199 msgstr ""
200
201-#: ../components/LocationManagerSheet.qml:288
202+#: components/LocationManagerSheet.qml:320
203 msgid "OK"
204 msgstr ""
205
206-#: ../components/LocationManagerSheet.qml:345
207+#: components/LocationManagerSheet.qml:370
208 msgid "Couldn't specify your current location, please try later again!"
209 msgstr ""
210
211-#: ../components/LocationTab.qml:167
212+#: components/LocationTab.qml:182
213+msgid "Forecast"
214+msgstr ""
215+
216+#: components/LocationTab.qml:351
217 msgid ""
218 "No weather data available at the moment, please try to refresh later again!"
219 msgstr ""
220
221-#: ../components/LocationTab.qml:200
222+#: components/LocationTab.qml:367
223 msgid "Refresh"
224 msgstr ""
225
226-#: ../components/LocationTab.qml:213
227+#: components/LocationTab.qml:380
228 msgid "Edit"
229 msgstr ""
230
231-#: ../components/LocationTab.qml:225 ../components/SettingsSheet.qml:27
232+#: components/LocationTab.qml:392 components/SettingsSheet.qml:27
233 msgid "Settings"
234 msgstr ""
235
236-#: ../components/SettingsSheet.qml:51
237+#: components/SettingsSheet.qml:52
238 msgid "Temperature units"
239 msgstr ""
240
241-#: ../components/SettingsSheet.qml:66
242+#: components/SettingsSheet.qml:67
243 msgid "Wind speed units"
244 msgstr ""
245
246-#: ../components/SettingsSheet.qml:81
247+#: components/SettingsSheet.qml:82
248 msgid "Precipitation units"
249 msgstr ""
250
251-#: ../components/SplashComponent.qml:33
252+#: components/SettingsSheet.qml:110
253+msgid "Weather Service"
254+msgstr ""
255+
256+#: components/SplashComponent.qml:35
257 msgid "Couldn't load weather data, please try later again!"
258 msgstr ""
259
260+#: components/TabFooter.qml:98
261+msgid "10 days forecast"
262+msgstr ""
263+
264+#: components/TabFooter.qml:120
265+msgid "Hourly forecast"
266+msgstr ""
267+
268 #. TRANSLATORS: this refers to the High (max) temperature forecasted for a day
269-#: ../components/WeatherTemperatureComponent.qml:102
270+#: components/WeatherTemperatureComponent.qml:233
271 msgid "H:"
272 msgstr ""
273
274 #. TRANSLATORS: this refers to the Low (min) temperature forecasted for a day
275-#: ../components/WeatherTemperatureComponent.qml:122
276+#: components/WeatherTemperatureComponent.qml:253
277 msgid "L:"
278 msgstr ""
279-
280-#: ../.build/ubuntu-weather-app.desktop.js:1
281-msgid "Weather"
282-msgstr ""
283
284=== removed file 'po/po.pro'
285--- po/po.pro 2013-09-26 05:44:31 +0000
286+++ po/po.pro 1970-01-01 00:00:00 +0000
287@@ -1,58 +0,0 @@
288-## This .pro file is used to create a Makefile with the necessary rules
289-## to create an initial translations template and to update it whenever
290-## there are new translatable strings in the project that are ready to be
291-## exposed to translators
292-##
293-## See the ../README.translations file for more information
294-
295-TEMPLATE = subdirs
296-
297-PROJECTNAME = $$system(basename ../*.qmlproject)
298-PROJECTNAME = $$replace(PROJECTNAME,.qmlproject,)
299-
300-DESKTOPFILE = ../$${PROJECTNAME}.desktop
301-
302-SOURCECODE = ../*.qml \
303- ../components/*.qml \
304- ../components/*.js
305-
306-BUILDDIR = ../.build
307-DESKTOPFILETEMP = $${BUILDDIR}/$${PROJECTNAME}.desktop.js
308-
309-message("")
310-message(" Project Name: $$PROJECTNAME ")
311-message(" Source Code: $$SOURCECODE ")
312-message("")
313-message(" Run 'make pot' to generate the pot file from source code. ")
314-message("")
315-
316-## Generate pot file 'make pot'
317-potfile.target = pot
318-potfile.commands = xgettext \
319- -o $${PROJECTNAME}.pot \
320- --copyright=\"Canonical Ltd. \" \
321- --package-name $${PROJECTNAME} \
322- --qt --c++ --add-comments=TRANSLATORS \
323- --keyword=tr --keyword=tr:1,2 \
324- $${SOURCECODE} $${DESKTOPFILETEMP}
325-potfile.depends = desktopfile
326-QMAKE_EXTRA_TARGETS += potfile
327-
328-## Do not use this rule directly. It's a dependency rule to
329-## generate an intermediate .js file to extract translatable
330-## strings from the .desktop file
331-desktopfile.target = desktopfile
332-desktopfile.commands = awk \'BEGIN { FS=\"=\" }; /Name/ {print \"var s = i18n.tr(\42\" \$$2 \"\42);\"}\' $${DESKTOPFILE} > $${DESKTOPFILETEMP}
333-desktopfile.depends = makebuilddir
334-QMAKE_EXTRA_TARGETS += desktopfile
335-
336-## Dependency rule to create the temporary build dir
337-makebuilddir.target = makebuilddir
338-makebuilddir.commands = mkdir -p $${BUILDDIR}
339-QMAKE_EXTRA_TARGETS += makebuilddir
340-
341-## Rule to clean the products of the build
342-clean.target = clean
343-clean.commands = rm -Rf $${BUILDDIR}
344-QMAKE_EXTRA_TARGETS += clean
345-

Subscribers

People subscribed via source and target branches