Merge lp:~dpm/ubuntu-calendar-app/rename into lp:ubuntu-calendar-app

Proposed by David Planella
Status: Superseded
Proposed branch: lp:~dpm/ubuntu-calendar-app/rename
Merge into: lp:ubuntu-calendar-app
Diff against target: 180 lines (+41/-20)
11 files modified
calendar-app (+1/-1)
calendar-app.desktop (+3/-3)
calendar.qml (+1/-1)
debian/calendar-app-autopilot.install (+1/-1)
debian/calendar-app.install (+5/-5)
debian/changelog (+12/-0)
debian/control (+4/-4)
debian/copyright (+1/-1)
debian/rules (+9/-0)
tests/autopilot/calendar_app/tests/__init__.py (+3/-3)
tests/autopilot/calendar_app/tests/test_calendar.py (+1/-1)
To merge this branch: bzr merge lp:~dpm/ubuntu-calendar-app/rename
Reviewer Review Type Date Requested Status
Olivier Tilloy (community) Needs Fixing
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+168982@code.launchpad.net

This proposal has been superseded by a proposal from 2013-06-17.

Commit message

Rename the project and add a build rule to generate and install compiled translations.

Description of the change

This merge proposal updates the qmake rule for creating the translation template (.pot file) and include translations from the .desktop file.

At the same time, it renames the project to calendar-app to follow the same naming convention as the system apps such as camera-app. The reason it's been done here is because parts of the project were already renamed, so I decided to go ahead and rename the rest to make the qmake rule for .desktop file translations work.

To post a comment you must log in.
lp:~dpm/ubuntu-calendar-app/rename updated
38. By David Planella

Merged from trunk, renamed autopilot tests to follow the same calendar-app naming convention

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
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

I’d rather have two separate merge requests: those changes are unrelated one with the other. Could you split this MR into two, one for the renaming, and one for the translations?

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

You might want to pass the -D flag to xgettext to ensure the paths in the pot file are relative to the root of the source tree.

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

So if I understand your code correctly, you’re injecting the "i18n.tr()" calls into a temporary copy of the desktop file. To mimick closer what we’re doing for the core apps using cmake, what about doing the reverse, i.e. having the calls to i18n.tr() already in a desktop.in file, and generating the desktop file from there by removing the calls to i18n.tr()? This would make for a more flexible solution, if in the future we need to translate more strings in the desktop file.

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

Al 12/06/13 18:36, En/na Olivier Tilloy ha escrit:
> I’d rather have two separate merge requests: those changes are unrelated one with the other. Could you split this MR into two, one for the renaming, and one for the translations?
I would have preferred to do it this way as well, but the fact that the
calendar app is already a bit different in terms of naming conventions
than the rest of the apps made it more difficult.

To give some background, we're intending to rename all community core
apps to $APPNAME-app at some point, to bring them inline with the naming
convention of the apps you guys are developing. That means we'll be
dropping the 'ubuntu-' prefix from the apps.

While we haven't started doing this, it seems that the calendar app has
already some files where the 'ubuntu-' prefix was dropped, which brings
some inconsistency and makes the po/po.pro rules fail (e.g. it is
expected that the .desktop file is named the same as the project file)

I see LP lets specify a branch for a MP as being dependent from another.
I'll see if I can separate them.

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

Al 12/06/13 18:43, En/na Olivier Tilloy ha escrit:
> You might want to pass the -D flag to xgettext to ensure the paths in the pot file are relative to the root of the source tree.
The current practice in gettext-based apps is to have the paths in the
.pot file be relative to the po/ folder instead of the root of the
source tree. I'd prefer sticking to that, which is what translators are
used to.

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

Al 12/06/13 18:49, En/na Olivier Tilloy ha escrit:
> So if I understand your code correctly, you’re injecting the "i18n.tr()" calls into a temporary copy of the desktop file.
Yeah, more or less. I'm extracting the translatable strings from the
.desktop file and putting them into a temporary .js file, which I then
feed to xgettext. I'm essentially mimicking the behaviour of intltool
when dealing with .desktop files: it extracts the strings, puts them in
a temporary .h file and then adds this file to the list of files for
xgettext to process.

The only difference is that I've made this temp file a valid .js file
instead of a C .h file.

> To mimick closer what we’re doing for the core apps using cmake, what about doing the reverse, i.e. having the calls to i18n.tr() already in a desktop.in file, and generating the desktop file from there by removing the calls to i18n.tr()? This would make for a more flexible solution, if in the future we need to translate more strings in the desktop file.
The difference in the community core apps is that essentially we're not
using a build system. I've simply added a .pro file so that we can
execute qmake to update the .pot file, but the rest of the files don't
need any build step.

If I modify the .desktop file to include i18n.tr() calls, I'll be adding
a step whereby before running any of the apps, they will need to be
built to generate the .desktop file from the .desktop.in file. Which
will probably need to have another .pro file at the top of the source tree.

I wanted to make the change as unintrusive as possible, and keep the
.desktop file untouched. In this way:

- Apps are run as before and don't need a build step
- To update the .pot file one can just run 'qmake && make pot' from the
po/ folder

At some point, we'll probably need to standardize on the same build
system across all apps, which I guess will be CMake. At that point,
we'll also be standardizing on the way we extract .desktop translations,
and the qmake rules will need to be changed in any way. But we're not
there yet, and to me (for the qmake-based apps), .desktop file
generation would bring drawbacks at this point.

I hope that makes sense.

lp:~dpm/ubuntu-calendar-app/rename updated
39. By David Planella

Reverted .desktop file translation changes, to be submitted in a separate branch

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 :

Updated the merge request to be separated in two as requested:

- MP for the renaming: this one
- MP for .desktop file support: https://code.launchpad.net/~dpm/ubuntu-calendar-app/desktop-file-i18n/+merge/169029

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

> Al 12/06/13 18:43, En/na Olivier Tilloy ha escrit:
> > You might want to pass the -D flag to xgettext to ensure the paths in the
> pot file are relative to the root of the source tree.
> The current practice in gettext-based apps is to have the paths in the
> .pot file be relative to the po/ folder instead of the root of the
> source tree. I'd prefer sticking to that, which is what translators are
> used to.

Ok, that makes sense. I wasn’t aware of this practice. Thanks for explaining.

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

> Al 12/06/13 18:49, En/na Olivier Tilloy ha escrit:
> > So if I understand your code correctly, you’re injecting the "i18n.tr()"
> calls into a temporary copy of the desktop file.
> Yeah, more or less. I'm extracting the translatable strings from the
> .desktop file and putting them into a temporary .js file, which I then
> feed to xgettext. I'm essentially mimicking the behaviour of intltool
> when dealing with .desktop files: it extracts the strings, puts them in
> a temporary .h file and then adds this file to the list of files for
> xgettext to process.
>
> The only difference is that I've made this temp file a valid .js file
> instead of a C .h file.
>
> > To mimick closer what we’re doing for the core apps using cmake, what about
> doing the reverse, i.e. having the calls to i18n.tr() already in a desktop.in
> file, and generating the desktop file from there by removing the calls to
> i18n.tr()? This would make for a more flexible solution, if in the future we
> need to translate more strings in the desktop file.
> The difference in the community core apps is that essentially we're not
> using a build system. I've simply added a .pro file so that we can
> execute qmake to update the .pot file, but the rest of the files don't
> need any build step.
>
> If I modify the .desktop file to include i18n.tr() calls, I'll be adding
> a step whereby before running any of the apps, they will need to be
> built to generate the .desktop file from the .desktop.in file. Which
> will probably need to have another .pro file at the top of the source tree.
>
> I wanted to make the change as unintrusive as possible, and keep the
> .desktop file untouched. In this way:
>
> - Apps are run as before and don't need a build step
> - To update the .pot file one can just run 'qmake && make pot' from the
> po/ folder
>
> At some point, we'll probably need to standardize on the same build
> system across all apps, which I guess will be CMake. At that point,
> we'll also be standardizing on the way we extract .desktop translations,
> and the qmake rules will need to be changed in any way. But we're not
> there yet, and to me (for the qmake-based apps), .desktop file
> generation would bring drawbacks at this point.
>
> I hope that makes sense.

That makes complete sense, thanks for the detailed explanation. If this is the way intltool does it, then it’s definitely the way to go. And not requiring any additional step for running the app is a must-have too.

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

Project-Id-Version in po/calendar-app.pot needs to be updated too.

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

72 +ubuntu-calendar-app (0.3) raring; urgency=low
73 +
74 + * Updated packaging to install translations
75 +
76 + -- David Planella <email address hidden> Tue, 28 May 2013 13:53:10 +0200

Is this changelog entry really meant to be added?

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

> 72 +ubuntu-calendar-app (0.3) raring; urgency=low
> 73 +
> 74 + * Updated packaging to install translations
> 75 +
> 76 + -- David Planella <email address hidden> Tue, 28 May 2013
> 13:53:10 +0200
>
> Is this changelog entry really meant to be added?

Ah, ok, just saw that you’re adding the rules to generate and install the mo files. I think the two changelog entries could be merged into one.

lp:~dpm/ubuntu-calendar-app/rename updated
40. By David Planella

Added required packaging changes for the rename

41. By David Planella

Merged from previous packaging translation changes branch

42. By David Planella

Merged from trunk

43. By David Planella

Found out a better way to replace a package

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== renamed file 'ubuntu-calendar-app' => 'calendar-app'
--- ubuntu-calendar-app 2013-02-12 16:27:52 +0000
+++ calendar-app 2013-06-12 18:16:24 +0000
@@ -1,2 +1,2 @@
1#!/bin/bash1#!/bin/bash
2qmlscene /usr/share/ubuntu-calendar-app/calendar.qml2qmlscene /usr/share/calendar-app/calendar.qml
33
=== renamed file 'ubuntu-calendar-app.desktop' => 'calendar-app.desktop'
--- ubuntu-calendar-app.desktop 2013-05-15 09:23:44 +0000
+++ calendar-app.desktop 2013-06-12 18:16:24 +0000
@@ -3,9 +3,9 @@
3Version=1.03Version=1.0
4Type=Application4Type=Application
5Terminal=false5Terminal=false
6Exec=qmlscene /usr/share/ubuntu-calendar-app/calendar.qml6Exec=qmlscene /usr/share/calendar-app/calendar.qml
7Icon=/usr/share/ubuntu-calendar-app/calendar64.png7Icon=/usr/share/calendar-app/calendar64.png
8Name=Calendar8Name=Calendar
9X-Ubuntu-Touch=true9X-Ubuntu-Touch=true
10X-Ubuntu-StageHint=SideStage10X-Ubuntu-StageHint=SideStage
11X-Ubuntu-Gettext-Domain=ubuntu-calendar-app11X-Ubuntu-Gettext-Domain=calendar-app
1212
=== renamed file 'calendar.qmlproject' => 'calendar-app.qmlproject'
=== modified file 'calendar.qml'
--- calendar.qml 2013-06-10 11:00:05 +0000
+++ calendar.qml 2013-06-12 18:16:24 +0000
@@ -6,7 +6,7 @@
6 id: mainView6 id: mainView
77
8 objectName: "calendar"8 objectName: "calendar"
9 applicationName: "ubuntu-calendar-app"9 applicationName: "calendar-app"
1010
11 width: units.gu(45)11 width: units.gu(45)
12 height: units.gu(80)12 height: units.gu(80)
1313
=== renamed file 'debian/ubuntu-calendar-app-autopilot.install' => 'debian/calendar-app-autopilot.install'
--- debian/ubuntu-calendar-app-autopilot.install 2013-05-27 15:12:42 +0000
+++ debian/calendar-app-autopilot.install 2013-06-12 18:16:24 +0000
@@ -1,1 +1,1 @@
1tests/autopilot/ubuntu_calendar_app/* usr/lib/python2.7/dist-packages/ubuntu_calendar_app/1tests/autopilot/calendar_app/* usr/lib/python2.7/dist-packages/calendar_app/
22
=== renamed file 'debian/ubuntu-calendar-app.install' => 'debian/calendar-app.install'
--- debian/ubuntu-calendar-app.install 2013-04-11 19:47:11 +0000
+++ debian/calendar-app.install 2013-06-12 18:16:24 +0000
@@ -1,5 +1,5 @@
1ubuntu-calendar-app usr/bin/1calendar-app usr/bin/
2ubuntu-calendar-app.desktop usr/share/applications/2calendar-app.desktop usr/share/applications/
3*.qml usr/share/ubuntu-calendar-app/3*.qml usr/share/calendar-app/
4*.png usr/share/ubuntu-calendar-app/4*.png usr/share/calendar-app/
5*.js usr/share/ubuntu-calendar-app/5*.js usr/share/calendar-app/
66
=== modified file 'debian/changelog'
--- debian/changelog 2013-04-04 21:27:58 +0000
+++ debian/changelog 2013-06-12 18:16:24 +0000
@@ -1,3 +1,15 @@
1calendar-app (0.4) raring; urgency=low
2
3 * Renamed package
4
5 -- David Planella <david.planella@ubuntu.com> Wed, 12 Jun 2013 17:25:52 +0200
6
7ubuntu-calendar-app (0.3) raring; urgency=low
8
9 * Updated packaging to install translations
10
11 -- David Planella <david.planella@ubuntu.com> Tue, 28 May 2013 13:53:10 +0200
12
1ubuntu-calendar-app (0.2) raring; urgency=low13ubuntu-calendar-app (0.2) raring; urgency=low
214
3 * Changing the app name so it can be closed by the hud (LP: #1164130).15 * Changing the app name so it can be closed by the hud (LP: #1164130).
416
=== modified file 'debian/control'
--- debian/control 2013-05-27 15:12:42 +0000
+++ debian/control 2013-06-12 18:16:24 +0000
@@ -1,4 +1,4 @@
1Source: ubuntu-calendar-app1Source: calendar-app
2Priority: extra2Priority: extra
3Maintainer: Ubuntu App Cats <ubuntu-touch-coreapps@lists.launchpad.net>3Maintainer: Ubuntu App Cats <ubuntu-touch-coreapps@lists.launchpad.net>
4Build-Depends: debhelper (>= 9), 4Build-Depends: debhelper (>= 9),
@@ -7,7 +7,7 @@
7Homepage: https://launchpad.net/ubuntu-calendar-app7Homepage: https://launchpad.net/ubuntu-calendar-app
8Vcs-Bzr: https://code.launchpad.net/~ubuntu-calendar-dev/ubuntu-calendar-app/trunk8Vcs-Bzr: https://code.launchpad.net/~ubuntu-calendar-dev/ubuntu-calendar-app/trunk
99
10Package: ubuntu-calendar-app10Package: calendar-app
11Architecture: all11Architecture: all
12Depends: ${misc:Depends},12Depends: ${misc:Depends},
13 qmlscene,13 qmlscene,
@@ -23,11 +23,11 @@
23 a diary, a planner, a journal, a life log; and the calendar will behave how23 a diary, a planner, a journal, a life log; and the calendar will behave how
24 you need it to.24 you need it to.
2525
26Package: ubuntu-calendar-app-autopilot26Package: calendar-app-autopilot
27Architecture: all27Architecture: all
28Depends: libautopilot-qt,28Depends: libautopilot-qt,
29 libqt5test5,29 libqt5test5,
30 ubuntu-calendar-app (= ${source:Version}),30 calendar-app (= ${source:Version}),
31Description: Autopilot tests for Ubuntu Calendar Application31Description: Autopilot tests for Ubuntu Calendar Application
32 This package contains autopilot tests for the Ubuntu Calendar application.32 This package contains autopilot tests for the Ubuntu Calendar application.
3333
3434
=== modified file 'debian/copyright'
--- debian/copyright 2013-04-11 19:47:11 +0000
+++ debian/copyright 2013-06-12 18:16:24 +0000
@@ -1,5 +1,5 @@
1Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/1Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2Upstream-Name: ubuntu-calendar-app2Upstream-Name: calendar-app
3Source: https://launchpad.net/ubuntu-calendar-app3Source: https://launchpad.net/ubuntu-calendar-app
44
5Files: *5Files: *
66
=== modified file 'debian/rules'
--- debian/rules 2013-04-11 19:47:11 +0000
+++ debian/rules 2013-06-12 18:16:24 +0000
@@ -9,3 +9,12 @@
99
10override_dh_install:10override_dh_install:
11 dh_install --fail-missing11 dh_install --fail-missing
12 appname=calendar-app; \
13 for pofile in $(shell find ./po -name "*.po"); do \
14 pofilename="$${pofile##*/}"; \
15 langcode="$${pofilename%.*}"; \
16 localedir="debian/$$appname/usr/share/locale/$$langcode/LC_MESSAGES"; \
17 mkdir -p $$localedir; \
18 mofile="$$localedir/$$appname.mo"; \
19 msgfmt -o $$mofile $$pofile; \
20 done
1221
=== renamed file 'po/ubuntu-calendar-app.pot' => 'po/calendar-app.pot'
=== renamed directory 'tests/autopilot/ubuntu_calendar_app' => 'tests/autopilot/calendar_app'
=== modified file 'tests/autopilot/calendar_app/tests/__init__.py'
--- tests/autopilot/ubuntu_calendar_app/tests/__init__.py 2013-05-29 15:38:29 +0000
+++ tests/autopilot/calendar_app/tests/__init__.py 2013-06-12 18:16:24 +0000
@@ -15,7 +15,7 @@
15from autopilot.testcase import AutopilotTestCase15from autopilot.testcase import AutopilotTestCase
16from testtools.matchers import Equals16from testtools.matchers import Equals
1717
18from ubuntu_calendar_app.emulators.main_window import MainWindow18from calendar_app.emulators.main_window import MainWindow
1919
2020
21class CalendarTestCase(AutopilotTestCase):21class CalendarTestCase(AutopilotTestCase):
@@ -48,8 +48,8 @@
48 def launch_test_installed(self):48 def launch_test_installed(self):
49 self.app = self.launch_test_application(49 self.app = self.launch_test_application(
50 "qmlscene",50 "qmlscene",
51 "/usr/share/ubuntu-calendar-app/calendar.qml",51 "/usr/share/calendar-app/calendar.qml",
52 "--desktop_file_hint=/usr/share/applications/ubuntu-calendar-app.desktop",52 "--desktop_file_hint=/usr/share/applications/calendar-app.desktop",
53 app_type='qt')53 app_type='qt')
5454
55 def reveal_toolbar(self):55 def reveal_toolbar(self):
5656
=== modified file 'tests/autopilot/calendar_app/tests/test_calendar.py'
--- tests/autopilot/ubuntu_calendar_app/tests/test_calendar.py 2013-05-29 16:38:15 +0000
+++ tests/autopilot/calendar_app/tests/test_calendar.py 2013-06-12 18:16:24 +0000
@@ -12,7 +12,7 @@
12from autopilot.matchers import Eventually12from autopilot.matchers import Eventually
13from testtools.matchers import Equals13from testtools.matchers import Equals
1414
15from ubuntu_calendar_app.tests import CalendarTestCase15from calendar_app.tests import CalendarTestCase
1616
1717
18class TestMainWindow(CalendarTestCase):18class TestMainWindow(CalendarTestCase):

Subscribers

People subscribed via source and target branches

to status/vote changes: