Merge lp:~dpm/ubuntu-calendar-app/package-translations into lp:ubuntu-calendar-app

Proposed by David Planella
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 37
Merged at revision: 49
Proposed branch: lp:~dpm/ubuntu-calendar-app/package-translations
Merge into: lp:ubuntu-calendar-app
Diff against target: 31 lines (+16/-0)
2 files modified
debian/changelog (+6/-0)
debian/rules (+10/-0)
To merge this branch: bzr merge lp:~dpm/ubuntu-calendar-app/package-translations
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Olivier Tilloy (community) Approve
Review via email: mp+166029@code.launchpad.net

Commit message

Add support for building and installing translations in the package.

Description of the change

This branch adds support for building and installing translations in the package.

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
Olivier Tilloy (osomon) wrote :

26 + localedir="debian/$$appname/usr/share/locale/$$langcode/LC_MESSAGES"; \
27 + mkdir -p $$localedir; \
28 + mofile="$$localedir/$$appname.mo"; \
29 + msgfmt -o $$mofile $$pofile; \

Wouldn’t it be cleaner to invoke dh_install with the generated mo file and the destination directory? E.g. something like that (not tested):

    localedir="usr/share/locale/$$langcode/LC_MESSAGES"; \
    mofile="$$appname.mo"; \
    msgfmt -o $$mofile $$pofile; \
    dh_install $$mofile $$localedir; \

36. By David Planella

Changed package installation rule as per feedback from Olivier Tilloy

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

I've gone ahead and implemented the suggestion. I'm aware that the right way to package this would probably be to have a top level .pro file and a .mo file creation rule in po/po.pro, and not do it on debian/rules. However, this is just a first iteration to keep the packaging simple and we'll update the packaging properly for all core apps in a subsequent iteration.

I've noticed one thing in implementing your suggestion: there is an ubuntu-calendar-app.mo file created on the top level dir as a product of package building, which is not removed by debuild clean. Any ideas how to get this file cleaned up/not created in the first place?

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've noticed one thing in implementing your suggestion: there is an ubuntu-
> calendar-app.mo file created on the top level dir as a product of package
> building, which is not removed by debuild clean. Any ideas how to get this
> file cleaned up/not created in the first place?

No idea, but I’ll give it a quick look.

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

> > I've noticed one thing in implementing your suggestion: there is an ubuntu-
> > calendar-app.mo file created on the top level dir as a product of package
> > building, which is not removed by debuild clean. Any ideas how to get this
> > file cleaned up/not created in the first place?

Found it, just add this line at the end of the for loop, after the call to dh_install:

    rm -f $$mofile; \

37. By David Planella

Cleaned up generated .mo files as part of the package installation

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

Looks good, thanks!

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 'debian/changelog'
2--- debian/changelog 2013-04-04 21:27:58 +0000
3+++ debian/changelog 2013-06-17 10:52:26 +0000
4@@ -1,3 +1,9 @@
5+ubuntu-calendar-app (0.3) raring; urgency=low
6+
7+ * Updated packaging to install translations
8+
9+ -- David Planella <david.planella@ubuntu.com> Tue, 28 May 2013 13:53:10 +0200
10+
11 ubuntu-calendar-app (0.2) raring; urgency=low
12
13 * Changing the app name so it can be closed by the hud (LP: #1164130).
14
15=== modified file 'debian/rules'
16--- debian/rules 2013-04-11 19:47:11 +0000
17+++ debian/rules 2013-06-17 10:52:26 +0000
18@@ -9,3 +9,13 @@
19
20 override_dh_install:
21 dh_install --fail-missing
22+ appname=ubuntu-calendar-app; \
23+ for pofile in $(shell find ./po -name "*.po"); do \
24+ pofilename="$${pofile##*/}"; \
25+ langcode="$${pofilename%.*}"; \
26+ localedir="usr/share/locale/$$langcode/LC_MESSAGES"; \
27+ mofile="$$appname.mo"; \
28+ msgfmt -o $$mofile $$pofile; \
29+ dh_install $$mofile $$localedir; \
30+ rm -f $$mofile; \
31+ done

Subscribers

People subscribed via source and target branches

to status/vote changes: