Automatic generation of translation templates

Last year, we integrated Launchpad Translations with Launchpad’s code hosting, meaning you could import both translations and templates from a Bazaar branch and also export translations to a branch.

Even at the time, we knew that the story wasn’t complete: you still had to somehow generate your translation templates (in the form of GNU gettext’s .pot files) and get them into your Bazaar branch before people could start translating your project in Launchpad.

However, we also knew that automatically generating translation templates was a big task.

Now, though, I’m pleased to say that Launchpad can automatically generate the templates on your behalf.

How to get it all set up for your project?

Automatic translation template generation relies on something called intltool. You’ll need to be familiar with intltool before you can get started with automatic template generation.

You first need to enable your branches for intltool and then set up a translation template import fromn the Bazaar branch that is linked to your project’s release series.

This means that, provided your branch has proper structure, you don’t even have to keep the POT file committed anymore (as a matter of fact, it’s better if you don’t). If your branch is not recognized as intltool branch, everything will keep working as before.

At this time, limits to what branches we consider intltool based are pretty strict: it has to have a POTFILES.in file in each of the template subdirectories, and be able to derive the domain name from Makevars DOMAIN variable or Makefile.in.in, configure.ac or configure.in gettext_PACKAGE variable (with very limited substitution supported). This will be further improved in the future, but plan is to support much more different layouts than just the intltool one.

We’ll be writing more about how to make the most of this in the coming weeks.

4 Responses to “Automatic generation of translation templates”

  1. Dmitrijs Ledkovs Says:

    Does it still get confused about package/help/manual.pot? and related package/help/lang/lang.po?

  2. Данило Шеган Says:

    The gnome-doc-utils layout is not supported yet (it’s an entirely different problem). Only intltool layout and re-generation of templates is. FWIW, this probably won’t really take effect until later tonight or tomorrow because of backlog branch-scanner is processing (all Maverick branches) and because we forgot to enable it.

  3. oliver Says:

    Semi-OT question: is there a way to get .pot files for the language-pack-* packages from Launchpad, without logging in? I’ve noticed that language-pack* source packages only contain .po files with actually translated strings (presumably to save CD-ROm space?); but I’d like to get .po or .pot files also with untranslated strings. Any idea how to get these?

  4. Dmitrijs Ledkovs Says:

    @oliver
    https://translations.edge.launchpad.net/ubuntu
    you can browse languages, packages and templates there and download them =)

    @Данило Шеган
    =( I’ll be waiting for it.

Leave a Reply