Merge lp:~dpm/ubuntu-weather-app/fix-cmake-i18n into lp:ubuntu-weather-app/obsolete.trunk

Proposed by David Planella
Status: Merged
Approved by: Martin Borho
Approved revision: 196
Merged at revision: 194
Proposed branch: lp:~dpm/ubuntu-weather-app/fix-cmake-i18n
Merge into: lp:ubuntu-weather-app/obsolete.trunk
Diff against target: 138 lines (+42/-21)
6 files modified
.bzrignore (+11/-3)
CMakeLists.txt (+9/-3)
README.translations (+6/-4)
com.ubuntu.weather_weather.desktop.in.in (+1/-1)
po/CMakeLists.txt (+13/-9)
ubuntu-weather-app.qmlproject (+2/-1)
To merge this branch: bzr merge lp:~dpm/ubuntu-weather-app/fix-cmake-i18n
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Martin Borho Approve
Nicholas Skaggs Pending
Review via email: mp+206374@code.launchpad.net

Commit message

Fix the rule to generate a .pot template after the migration to cmake

Description of the change

Fix the rule to generate a .pot template after the migration to cmake

To post a comment you must log in.
Revision history for this message
Martin Borho (martin-borho) wrote :

Looks okay for me.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2013-09-26 05:47:45 +0000
3+++ .bzrignore 2014-02-14 09:55:02 +0000
4@@ -1,8 +1,16 @@
5-*.qmlproject.user
6-
7+*.qmlproject.user*
8 debian/files
9+debian/tmp
10+debian/ubuntu-weather-app*
11 debian/app-template/
12 debian/*.debhelper.log
13 debian/*.substvars
14-po/Makefile
15+Makefile
16 .build
17+.excludes
18+CMakeCache.txt
19+CMakeFiles/
20+*.cmake
21+*.gmo
22+*.mo
23+*.desktop
24
25=== modified file 'CMakeLists.txt'
26--- CMakeLists.txt 2014-02-13 01:09:38 +0000
27+++ CMakeLists.txt 2014-02-14 09:55:02 +0000
28@@ -40,17 +40,23 @@
29
30 file(GLOB_RECURSE I18N_SRC_FILES
31 RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
32- rc/**.qml desktop/**.desktop.in)
33+ components/*.qml components/*.js ${DESKTOP_FILE}.in.in)
34 list(SORT I18N_SRC_FILES)
35
36-
37 file(GLOB SRC_FILES
38 RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
39 *.qml *.js *.png *.js)
40 install(DIRECTORY components resources DESTINATION ${DATA_DIR})
41 install(FILES ${MAIN_QML} DESTINATION ${DATA_DIR})
42
43-configure_file(${DESKTOP_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE})
44+configure_file(${DESKTOP_FILE}.in.in ${DESKTOP_FILE}.in @ONLY)
45+file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE})
46+file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}.in DESKTOP_FILE_CONTENTS)
47+foreach(LINE ${DESKTOP_FILE_CONTENTS})
48+ string(REGEX REPLACE "tr\\\(\"(.*)\"\\\)" "\\1" LINE "${LINE}")
49+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE} "${LINE}\n")
50+endforeach(LINE)
51+
52 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}
53 DESTINATION ${DESKTOP_DIR})
54
55
56=== modified file 'README.translations'
57--- README.translations 2013-09-26 05:41:19 +0000
58+++ README.translations 2014-02-14 09:55:02 +0000
59@@ -10,10 +10,12 @@
60 translatable messages to translators. So whenever you add new translatable
61 messages in the code, make sure to follow these steps:
62
63- 1. Change directory to the po/ folder: `cd po`
64- 2. Update the translations template: `qmake && make pot`
65- 3. Commit the generated .pot file: `bzr commit -m"Updated translation template"`
66- 4. Push the branch and send a merge proposal as usual
67+ 1. Create a build directory: `mkdir ../build && cd ../build`
68+ 2. Run the cmake config: `cmake ../<original-branch>`
69+ 3. Build the project to generate the updated .pot file: `make`
70+ 4. Copy the .pot file to your original sources: `cp po/*.pot ../<original-branch>`
71+ 5. Commit the generated .pot file: `bzr commit -m"Updated translation template"`
72+ 6. Push the branch and send a merge proposal as usual
73
74 And that's it, once the branch lands Launchpad should take care of all the rest!
75
76
77=== renamed file 'com.ubuntu.weather_weather.desktop.in' => 'com.ubuntu.weather_weather.desktop.in.in'
78--- com.ubuntu.weather_weather.desktop.in 2014-01-31 21:06:15 +0000
79+++ com.ubuntu.weather_weather.desktop.in.in 2014-02-14 09:55:02 +0000
80@@ -4,7 +4,7 @@
81 Terminal=false
82 Exec=@EXEC@
83 Icon=@ICON@
84-Name=Weather
85+Name=tr("Weather")
86 X-Ubuntu-Touch=true
87 X-Ubuntu-StageHint=SideStage
88 X-Ubuntu-Gettext-Domain=@PROJECT_NAME@
89
90=== modified file 'po/CMakeLists.txt'
91--- po/CMakeLists.txt 2014-01-31 21:06:15 +0000
92+++ po/CMakeLists.txt 2014-02-14 09:55:02 +0000
93@@ -5,16 +5,20 @@
94 set(POT_FILE ${DOMAIN}.pot)
95 file(GLOB PO_FILES *.po)
96
97-add_custom_target(${POT_FILE}
98- COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE}
99- -D ${CMAKE_SOURCE_DIR}
100- --from-code=UTF-8
101- --c++ --qt --add-comments=TRANSLATORS
102- --keyword=tr --keyword=tr:1,2
103- --package-name='${PROJECT}'
104- --copyright-holder='Canonical Ltd.'
105- ${I18N_SRC_FILES})
106+# Creates the .pot file containing the translations template
107+add_custom_target(${POT_FILE} ALL
108+ COMMENT "Generating translation template"
109+ COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE}
110+ -D ${CMAKE_SOURCE_DIR}
111+ --from-code=UTF-8
112+ --c++ --qt --add-comments=TRANSLATORS
113+ --keyword=tr --keyword=tr:1,2
114+ --package-name='${PROJECT}'
115+ --copyright-holder='Canonical Ltd.'
116+ ${I18N_SRC_FILES})
117
118+# Builds the binary translations catalog for each language
119+# it finds source translations (*.po) for
120 foreach(PO_FILE ${PO_FILES})
121 get_filename_component(LANG ${PO_FILE} NAME_WE)
122 gettext_process_po_files(${LANG} ALL PO_FILES ${PO_FILE})
123
124=== renamed file 'po/ubuntu-weather-app.pot' => 'po/com.ubuntu.weather.pot'
125=== modified file 'ubuntu-weather-app.qmlproject'
126--- ubuntu-weather-app.qmlproject 2013-09-26 05:41:19 +0000
127+++ ubuntu-weather-app.qmlproject 2014-02-14 09:55:02 +0000
128@@ -23,8 +23,9 @@
129 Files {
130 filter: "*.po*"
131 }
132+ /* Shows the CMake files */
133 Files {
134- filter: "*.pro"
135+ filter: "CMakeLists.txt"
136 }
137 /* List of plugin directories passed to QML runtime */
138 importPaths: [ "." ,"/usr/lib/x86_64-linux-gnu/qt5/qml" ]

Subscribers

People subscribed via source and target branches