Preferences dialog is not translatable

Bug #452897 reported by David Planella
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Onboard
Fix Released
Undecided
Unassigned
Ubuntu Translations
Fix Released
Medium
Unassigned
onboard (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: onboard

The preferences dialog is not translatable due to its strings in the .ui file not being extracted and merged into the POT translation template.

This in turn was caused by bug 451170 in python-distutils-extra, which has now been solved

Tags: i18n

Related branches

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

Here's a patch with an attempt to fix this

Changed in ubuntu-translations:
assignee: nobody → David Planella (dpm)
status: New → In Progress
importance: Undecided → Medium
Revision history for this message
David Planella (dpm) wrote :

I've now manually imported the attached POT file resulting from applying the patch into Lapunchpad, which will at least allow translators to translate the onboard settings dialog in Launchpad and translations to be exported in language packs until the bug is fixed.

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

The bug is still in Lucid, could someone perhaps have a look at the patch? Thanks!

Changed in onboard (Ubuntu):
status: New → Confirmed
Revision history for this message
Francesco Fumanti (frafu) wrote :

Hi David,

First of all, thanks for your interest in onboard.

In the bug description you say: "The preferences dialog is not translatable due to its strings in the .ui file not being extracted and merged into the POT translation template."

Could you please tell me how launchpad gets the .pot file for its translations? Does it simply copy the file from the uploaded debian source package or does it generate a new .pot file from the debian source package?

If I remember correctly, the problem did not occur when I created the debian package from the checkout of the onboard repository and I might know why: the repository contains a POTFILES.in file specifying from what files it has to extract strings for the POT translation template.

Unfortunately, I was not aware that the "./setup. py sdist" command that I used to create the release tarball does not include the POTFILES.in file into the release tarball; consequently, when building the debian package by using the release tarball without using the langpack.mk command in debian/rules, it does not merge the strings from the settings.ui file into the template.

Do you think that it makes sense to file a bug against the DistUtilsExtra package because it does not include the POTFILES into the release tarball? Or is there any reason for not including the POTFILES into the release tarball? (Unfortunately, I don't have a good knowledge about these things.)

Revision history for this message
David Planella (dpm) wrote : Re: [Bug 452897] Re: Preferences dialog is not translatable

Hi Francesco,

El dv 29 de 01 de 2010 a les 21:10 +0000, en/na Francesco Fumanti va
escriure:
> Hi David,
>
> First of all, thanks for your interest in onboard.
>
> In the bug description you say: "The preferences dialog is not
> translatable due to its strings in the .ui file not being extracted and
> merged into the POT translation template."
>
> Could you please tell me how launchpad gets the .pot file for its
> translations? Does it simply copy the file from the uploaded debian
> source package or does it generate a new .pot file from the debian
> source package?
>

Launchpad does not generate any .pot templates, it just gets fed the
templates the debian package generates as a result of the build. This is
the only requirement for Ubuntu packages in main which need to have
their translations imported into Launchpad: they must produce a .pot
template during build.

The way this is generally achieved with CDBS-based packages is through
the langpack.mk rule in debian/rules, which takes care of all of this
for you (that's why I included it in the patch).

You'll find more detailed info at:

* https://wiki.ubuntu.com/Translations/TranslationLifecycle
* https://wiki.ubuntu.com/UbuntuDevelopment/Internationalisation/Packaging

> If I remember correctly, the problem did not occur when I created the
> debian package from the checkout of the onboard repository and I might
> know why: the repository contains a POTFILES.in file specifying from
> what files it has to extract strings for the POT translation template.
>

By looking at setup.py, I saw that you are using DistUtilsExtra.auto.
IIRC, the auto module takes care of inferring from which files to
extract strings from, without the explicit need of a POTFILES.in file.

> Unfortunately, I was not aware that the "./setup. py sdist" command that
> I used to create the release tarball does not include the POTFILES.in
> file into the release tarball; consequently, when building the debian
> package by using the release tarball without using the langpack.mk
> command in debian/rules, it does not merge the strings from the
> settings.ui file into the template.
>

For the Ubuntu package you should probably be using the langpack.mk
rule. If I understand it correctly, the problem is when building the
package for Debian, where the langpack.mk rule is not needed and thus
not used?

Could it be that in the Debian version of python-distutils-extra the bug
where .ui files where ignored for extraction has not yet been fixed?

> Do you think that it makes sense to file a bug against the
> DistUtilsExtra package because it does not include the POTFILES into the
> release tarball? Or is there any reason for not including the POTFILES
> into the release tarball?

In any case, the DistUtilsExtra version in which bug 451170 is fixed
should recognize the .ui files and extract the translations without the
need of the POTFILES.in file. When I created the patch I tested this was
so. Is that not happening?

> (Unfortunately, I don't have a good knowledge
> about these things.)
>

Don't worry about this, I'm also learning as I go along :)

I hope this helps.

Revision history for this message
Francesco Fumanti (frafu) wrote :

Hi David,

First of all, thanks for the explanations and the links.

While playing around with the changes that you proposed in your patch, I discovered the following (I used the package currently available in the repository of lucid): I only have to delete the following line from the setup command in setup.py in order to have the strings from the ui file merged into the POT template.
('share/onboard/data', glob.glob('data/*.ui*')),

So it seems that the ui file is automatically merged in the POT template only if it is also automatically picked up; it must not be explicitely added to the package with a line in the setup command.

And now, there is not any difference anymore between creating the POT template by using the "./setup.py build_i18n" command and the "dpkg-buildpackage -b" commands. (In fact, the langpack.mk rule fixed the problem only for "dpkg-buildpackage -b" and not for "./setup.py build_i18n"; I thought that this difference should be solved through the usage of a POTFILES.in file, but it turned out that the POTFILES.in file is not necessary either in both cases. )

Tomorrow, I will try to understand why the setup.cfg file is not necessary anymore, as your patch is suggesting.

Thanks again for all your help.

Changed in onboard:
status: New → Fix Committed
Changed in onboard (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package onboard - 0.93.0-0ubuntu1

---------------
onboard (0.93.0-0ubuntu1) lucid; urgency=low

  * New upstream release (LP: #523403)
    - Add option to make onboard appear when unlocking the screen
    - Add possibility to do a middle click/right click by doing a left click
    - Fix for the translations (LP: #452897)
    - Replace with-keyword for compatibility with python < 2.6 (LP: #460389)
    - Do not launch settings dialog under GDM (LP: #440371)
    - Minimize to IconPalette if running under GDM, instead of disappearing
    - Fix capitalisation of the word GNOME (LP: #495526)
    - Check against version of auto module and not against version of package
    - Make it compatible to DistUtilsExtra.auto >= 2.10
    - Adjust permissions and fix typo (LP: #461491)
    - Fix long description in schemas file
    - Fix keysym of Del key
    - Fix taskbar icon visibility (LP: #456178)
  * debian/control:
    - Replace python-dev with python in Build-Depends
    - Update Standards-Version
    - Require python-distutils-extra >= 2.10
    - Add target to remove POT file on clean
  * debian/rules:
    - Add simple-patchsys.mk
 -- Francesco Fumanti <email address hidden> Wed, 17 Feb 2010 20:54:10 +0100

Changed in onboard (Ubuntu):
status: Fix Committed → Fix Released
David Planella (dpm)
Changed in ubuntu-translations:
status: In Progress → Fix Released
assignee: David Planella (dpm) → nobody
Changed in onboard:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments