ufw

ufw package contains mo files

Bug #626178 reported by Gabor Kelemen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Translations
Triaged
Low
Unassigned
ufw
Triaged
Low
Unassigned
ufw (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: ufw

The ufw package is in main, and its translations are already part of the language packs:
$ dpkg -S /usr/share/locale-langpack/hu/LC_MESSAGES/ufw.mo
language-pack-hu-base: /usr/share/locale-langpack/hu/LC_MESSAGES/ufw.mo

Yet it still contains mo files:
http://packages.ubuntu.com/maverick/all/ufw/filelist

Related branches

David Planella (dpm)
Changed in ubuntu-translations:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

After talking with David Planella, this is not actually a packaging problem with ufw, but a problem with the script that strips out the translations. Marking ufw task as "Invalid".

Changed in ufw (Ubuntu):
status: New → Invalid
Revision history for this message
Gabor Kelemen (kelemeng) wrote :

I took another look on this. The problem is not in the packaging, but in the general build process - it puts translation files to /usr/share/ufw/messages, and for some reason, ufw is unable to find them there, so if I remove the ufw.mo file installed by the langpack, I get no more translations.
I think using build_i18n from python-distutils-extra could simplify the setup script, make ufw find its installed translations in their usual (non-langpack) location, and get the mo files out of the binary package.

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

Ok, so after Gabor's comment I had another look as well. I've linked a branch that fixes the problem in the code.

However, I haven't submitted a merge proposal yet because the fix still needs some extra bits on the packaging side, and I'm not an expert on that.

Basically, what I've done is to use python-distutils-extra to add support for building translations and updating the .pot file using standard practices. What is left to do is:
a) that the package calls python-distutils-extra during the build in order to build and install the .mo files, and
b) that the package produces a .pot file on build.

Generally, the CDBS-based packages I've seen use the following classes to do that, which take care of everything, but I'm not too sure how to best do it with the ufw package.

include /usr/share/cdbs/1/class/python-distutils.mk
include /usr/share/cdbs/1/rules/langpack.mk

Jamie, do you think you could have a look at it and add the missing packaging bits to the linked branch?

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

In principle, I am fine with the changes, but have a couple of questions:
1. python-distutils-extra (>= 2.4) is added to debian/control. Ideally I would want these changes to be compatible on hardy since I hope to provide backports for hardy. This is not a hard requirement. What would need to be done for 1.91.2 (python-distutils-extra from hardy)
2. with python-distutils-extra, it is my understanding that the mo files will be built at build time, via the packaging. I guess I am going to have to review that and update the documentation as ufw upstream would like to have these built in some way for people using source tarballs. Is there some standard way to do this?

Revision history for this message
David Planella (dpm) wrote : Re: [Bug 626178] Re: ufw package contains mo files

El dt 17 de 05 de 2011 a les 22:16 +0000, en/na Jamie Strandboge va
escriure:
> In principle, I am fine with the changes, but have a couple of questions:
> 1. python-distutils-extra (>= 2.4) is added to debian/control. Ideally I would want these changes to be compatible on hardy since I hope to provide backports for hardy. This is not a hard requirement. What would need to be done for 1.91.2 (python-distutils-extra from hardy)

Looking at the python-distutils-extra changelog, it seems that support
for the 'auto' mode (the one used in the proposed branch) was not added
until 2.0 (post-Hardy).

So one thing we could do is to switch to the old 'command' mode from
p-d-e, which requires a bit more static configuration but should work
nevertheless.

The drawback here is that you'll need to manually maintain the
po/POTFILES.in file (i.e. you'll have to keep the names of the
translatable files in POTFILES.in in sync with the names of the actual
files in the tree).

Here's a branch that does that:

http://bazaar.launchpad.net/~dpm/ufw/i18n-fixes-hardy/revision/744

(the changes are relative to the previously submitted i18n-fixes branch)

> 2. with python-distutils-extra, it is my understanding that the mo files will be built at build time, via the packaging. I guess I am going to have to review that and update the documentation as ufw upstream would like to have these built in some way for people using source tarballs. Is there some standard way to do this?
>

The .mo files can be built from the tarballs as well. When I first
submitted the branch I also updated the documentation. This is explained
here:

http://bazaar.launchpad.net/~dpm/ufw/i18n-fixes/view/head:/README.translations#L4

In short, you can run:

./setup.py build_i18n

and the .mo files will be built in the build/mo directory.

--
David Planella
Ubuntu Translations Coordinator
www.ubuntu.com / www.davidplanella.wordpress.com
www.identi.ca/dplanella / www.twitter.com/dplanella

Changed in ufw:
status: New → Triaged
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.