Merge lp:~phablet-team/gallery-app/desktop-i18n into lp:gallery-app

Proposed by Ugo Riboni
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 1066
Merged at revision: 1065
Proposed branch: lp:~phablet-team/gallery-app/desktop-i18n
Merge into: lp:gallery-app
Diff against target: 186 lines (+48/-34)
6 files modified
.bzrignore (+2/-0)
CMakeLists.txt (+3/-5)
desktop/CMakeLists.txt (+5/-7)
desktop/gallery-app.desktop.in.in (+4/-4)
po/CMakeLists.txt (+16/-5)
po/gallery-app.pot (+18/-13)
To merge this branch: bzr merge lp:~phablet-team/gallery-app/desktop-i18n
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Olivier Tilloy Approve
David Planella (community) Approve
Review via email: mp+234679@code.launchpad.net

Commit message

Translate the .desktop file inline

Description of the change

Translate the .desktop file inline

To post a comment you must log in.
Revision history for this message
David Planella (dpm) wrote :

Looks good to me, thanks!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

83 +_Keywords=Photograps;Pictures;Albums

typo: s/Photograps/Photographs/

review: Needs Fixing
Revision history for this message
Olivier Tilloy (osomon) wrote :

125 + -D ${CMAKE_BINARY_DIR} ${DESKTOP_FILE_IN_IN_H})

Earlier in the same file, DESKTOP_FILE_IN_IN_H is defined relative to CMAKE_SOURCE_DIR, not to CMAKE_BINARY_DIR. So I think the "-D ${CMAKE_BINARY_DIR}" option can be removed altogether.

1064. By Ugo Riboni

Fix a typo and remove unnecessary definition

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

With the last change I suggested, the code fails to build in an out-of-source configuration (try locally with: "mkdir build; cd build; cmake ..; make").

Looking more closely at those lines:

95 +file(RELATIVE_PATH DESKTOP_FILE_IN_IN ${CMAKE_SOURCE_DIR}
96 + ${CMAKE_SOURCE_DIR}/desktop/${DESKTOP_FILE}.in.in)

This file command looks useless, it could be simplified to "set(DESKTOP_FILE_IN_IN desktop/${DESKTOP_FILE}.in.in)".

97 +file(RELATIVE_PATH DESKTOP_FILE_IN_IN_H ${CMAKE_SOURCE_DIR}
98 + ${CMAKE_CURRENT_SOURCE_DIR}/${DESKTOP_FILE_IN_IN}.h)

Why is the DESKTOP_FILE_IN_IN_H path built from the current source dir? Isn’t it supposed to be generated in the current binary dir?

Please clarify, and actually test that at least an out-of-source build works (ideally an in-source build too, as I think it’s supposed to work with the current trunk) before commiting. Thanks.

review: Needs Fixing
1065. By Ugo Riboni

Fix out of tree builds, and simplify

Revision history for this message
Olivier Tilloy (osomon) wrote :

This isn’t correct either:

96 +set(DESKTOP_FILE_IN_IN_H ${CMAKE_CURRENT_BINARY_DIR}/desktop/${DESKTOP_FILE}.in.in.h)

DESKTOP_FILE_IN_IN_H needs to be relative to CMAKE_SOURCE_DIR (or to some other place known to the build system, and then you need to pass a -D parameter to xgettext again).

This can be easily verified: if I build the code locally, it won’t update the translation template anymore, whereas it should (at least the timestamp).

review: Needs Fixing
1066. By Ugo Riboni

fix a silent failure in xgettext by specifying paths correctly

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

LGTM now. Thanks!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (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-06-18 07:56:00 +0000
3+++ .bzrignore 2014-09-16 12:17:45 +0000
4@@ -1,6 +1,7 @@
5 /CMakeLists.txt.user
6 /gallery-app.qmlproject.user
7 /desktop/gallery-app.desktop
8+/desktop/gallery-app.desktop.in
9 /src/config.h
10 /src/gallery-app
11 /tests/unittests/command-line-parser/command-line-parser
12@@ -14,6 +15,7 @@
13 /tests/unittests/*/test_*.xml
14 /Testing
15 /po/*.gmo
16+/po/desktop
17 CMakeCache.txt
18 CMakeFiles
19 CTestTestfile.cmake
20
21=== modified file 'CMakeLists.txt'
22--- CMakeLists.txt 2014-08-08 21:22:15 +0000
23+++ CMakeLists.txt 2014-09-16 12:17:45 +0000
24@@ -45,6 +45,9 @@
25
26 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror")
27
28+find_program(INTLTOOL_MERGE intltool-merge)
29+find_program(INTLTOOL_EXTRACT intltool-extract)
30+
31 # Standard install paths
32 include(GNUInstallDirs)
33
34@@ -68,11 +71,6 @@
35 set(GALLERY_DIR ${CMAKE_INSTALL_DATADIR}/${GALLERY})
36 endif(CLICK_MODE)
37
38-file(GLOB_RECURSE I18N_SRC_FILES
39- RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
40- rc/**.qml desktop/**.desktop.in)
41-list(SORT I18N_SRC_FILES)
42-
43 # for dh_translations to extract the domain
44 # (regarding syntax consistency, see http://pad.lv/1181187)
45 set (GETTEXT_PACKAGE "${GALLERY}")
46
47=== modified file 'desktop/CMakeLists.txt'
48--- desktop/CMakeLists.txt 2014-01-11 22:06:28 +0000
49+++ desktop/CMakeLists.txt 2014-09-16 12:17:45 +0000
50@@ -10,13 +10,11 @@
51 set(ICON "${GALLERY}")
52 endif(CLICK_MODE)
53
54-file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE})
55-file(STRINGS ${DESKTOP_FILE}.in DESKTOP_FILE_CONTENTS)
56-foreach(LINE ${DESKTOP_FILE_CONTENTS})
57- string(REGEX REPLACE "tr\\\(\"(.*)\"\\\)" "\\1" LINE "${LINE}")
58- string(CONFIGURE "${LINE}" LINE)
59- file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE} "${LINE}\n")
60-endforeach(LINE)
61+configure_file(${DESKTOP_FILE}.in.in ${DESKTOP_FILE}.in @ONLY)
62+add_custom_target(${DESKTOP_FILE} ALL
63+ COMMENT "Merging translations into ${DESKTOP_FILE}"
64+ COMMAND ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po
65+ ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}.in ${DESKTOP_FILE})
66
67 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}
68 DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
69
70=== renamed file 'desktop/gallery-app.desktop.in' => 'desktop/gallery-app.desktop.in.in'
71--- desktop/gallery-app.desktop.in 2014-02-20 17:53:20 +0000
72+++ desktop/gallery-app.desktop.in.in 2014-09-16 12:17:45 +0000
73@@ -1,9 +1,9 @@
74 [Desktop Entry]
75 Version=1.0
76-Name=tr("Gallery")
77-GenericName=tr("Ubuntu Photo Viewer")
78-X-GNOME-Fullname=tr("Ubuntu Photo Viewer")
79-Comment=tr("Browse your photographs")
80+_Name=Gallery
81+_GenericName=Ubuntu Photo Viewer
82+_Comment=Browse your photographs
83+_Keywords=Photographs;Pictures;Albums
84 Exec=@APP_EXEC@ %u
85 Icon=@ICON@
86 StartupNotify=true
87
88=== modified file 'po/CMakeLists.txt'
89--- po/CMakeLists.txt 2014-05-09 19:52:57 +0000
90+++ po/CMakeLists.txt 2014-09-16 12:17:45 +0000
91@@ -3,19 +3,30 @@
92 include(FindGettext)
93 find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext)
94
95+set(DESKTOP_FILE_IN_IN desktop/${DESKTOP_FILE}.in.in)
96+set(DESKTOP_FILE_IN_IN_H ${DESKTOP_FILE_IN_IN}.h)
97+
98+file(GLOB_RECURSE I18N_SRC_FILES
99+ RELATIVE ${CMAKE_SOURCE_DIR}
100+ ${CMAKE_SOURCE_DIR}/rc/**.qml)
101+list(SORT I18N_SRC_FILES)
102+
103 set(DOMAIN ${GETTEXT_PACKAGE})
104 set(POT_FILE ${DOMAIN}.pot)
105 file(GLOB PO_FILES *.po)
106
107-add_custom_target(${POT_FILE}
108- COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${CMAKE_SOURCE_DIR}/po/${POT_FILE}
109- -D ${CMAKE_SOURCE_DIR}
110+add_custom_target(${POT_FILE} ALL
111+ COMMENT "Generating translation template"
112+ COMMAND ${INTLTOOL_EXTRACT} --update --type=gettext/ini
113+ --srcdir=${CMAKE_SOURCE_DIR} ${DESKTOP_FILE_IN_IN}
114+ COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE}
115 --from-code=UTF-8
116 --c++ --qt --add-comments=TRANSLATORS
117- --keyword=tr --keyword=tr:1,2
118+ --keyword=tr --keyword=tr:1,2 --keyword=N_
119 --package-name='${GALLERY}'
120 --copyright-holder='Canonical Ltd.'
121- ${I18N_SRC_FILES})
122+ -D ${CMAKE_SOURCE_DIR} ${I18N_SRC_FILES}
123+ -D ${CMAKE_CURRENT_BINARY_DIR} ${DESKTOP_FILE_IN_IN_H})
124
125 foreach(PO_FILE ${PO_FILES})
126 get_filename_component(LANG ${PO_FILE} NAME_WE)
127
128=== modified file 'po/gallery-app.pot'
129--- po/gallery-app.pot 2014-09-15 07:59:56 +0000
130+++ po/gallery-app.pot 2014-09-16 12:17:45 +0000
131@@ -8,7 +8,7 @@
132 msgstr ""
133 "Project-Id-Version: gallery-app\n"
134 "Report-Msgid-Bugs-To: \n"
135-"POT-Creation-Date: 2014-09-15 09:59+0200\n"
136+"POT-Creation-Date: 2014-09-16 14:16+0200\n"
137 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
138 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
139 "Language-Team: LANGUAGE <LL@li.org>\n"
140@@ -17,18 +17,6 @@
141 "Content-Type: text/plain; charset=UTF-8\n"
142 "Content-Transfer-Encoding: 8bit\n"
143
144-#: desktop/gallery-app.desktop.in:3 rc/qml/MediaViewer/PopupPhotoViewer.qml:56
145-msgid "Gallery"
146-msgstr ""
147-
148-#: desktop/gallery-app.desktop.in:4 desktop/gallery-app.desktop.in:5
149-msgid "Ubuntu Photo Viewer"
150-msgstr ""
151-
152-#: desktop/gallery-app.desktop.in:6
153-msgid "Browse your photographs"
154-msgstr ""
155-
156 #: rc/qml/AlbumEditor/AlbumEditMenu.qml:43
157 #: rc/qml/AlbumEditor/AlbumEditor.qml:35
158 msgid "Edit album"
159@@ -209,6 +197,11 @@
160 msgid "Play"
161 msgstr ""
162
163+#: rc/qml/MediaViewer/PopupPhotoViewer.qml:56
164+#: desktop/gallery-app.desktop.in.in.h:1
165+msgid "Gallery"
166+msgstr ""
167+
168 #: rc/qml/PhotosOverview.qml:74
169 msgid "Delete photos"
170 msgstr ""
171@@ -329,3 +322,15 @@
172 #: rc/qml/Utility/PhotosToolbarActions.qml:43
173 msgid "Import"
174 msgstr ""
175+
176+#: desktop/gallery-app.desktop.in.in.h:2
177+msgid "Ubuntu Photo Viewer"
178+msgstr ""
179+
180+#: desktop/gallery-app.desktop.in.in.h:3
181+msgid "Browse your photographs"
182+msgstr ""
183+
184+#: desktop/gallery-app.desktop.in.in.h:4
185+msgid "Photographs;Pictures;Albums"
186+msgstr ""

Subscribers

People subscribed via source and target branches

to all changes: