Translations/ImportingFromBazaarBranches

Not logged in - Log In / Register

Revision 1 as of 2009-03-27 23:39:39

Clear message

You can ask Launchpad to automatically import your translation templates from your project's official Bazaar branches hosted in Launchpad.

Activating automatic translation imports for Bazaar branches

First off, you -- the project owner -- need to link each project series, for which you want to automatically import translation templates, to its Bazaar branch.

  1. Visit the project series overview page and click Link to branch.

  2. Next, select the branch and click Update.

If you've previously liked the series to a branch, you can skip straight to enabling automatic template imports.

  1. Visit the translations overview page for the series and click Settings.

  2. Next, select Import PO Templates, then click Save settings.

The order in which you complete the two stages does matter to an extent: the Translations Settings form shows you the branch associated with the series, making it easier to confirm that you've selected the branch.

Once you've completed both stages, Launchpad will schedule its first import to take place within the next 15 minutes.

Adding and updating templates

To update or add a template all you need to do is commit the template file to the branch.

Launchpad's branch scanner will find the templates and then add them to the import queue. Once approved, the template will appear in the translation tab for the product series.

Naming templates

Since a template file does not carry any metadata, all information about it must be derived from its path. The metadata is needed to either create a new template entry in Launchpad Translations or to match the file to an existing entry. The metadata consists of the translation domain and the template name. The latter is derived from the former which in turn is extracted from the path.

These are the ways to specifiy the translation domain, the first match will be used:

  1. In the file name itself: domain.pot or po/domain.pot, etc.

  2. If the file name is generic (one of messages.pot, template.pot or untitled.pot), in the containing directory: domain/messages.pot or po/domain/messages.pot

  3. Or in the module directory: domain/po/messages.pot (only "po" is recognized as an intermediate directory in the path).

The template name is derived from the domain by replacing underscores (_) with dashes (-).

Automatic approval

One of the big advantages of importing templates directly from your series Bazaar branch is that your templates may be automatically approved.

To assure automatic approval, these conditions must be met:

The latter condition is there to avoid creating new template entries when in reality the existing template entry was to be renamed. This and any other case will not be approved automatically and must be reviewed by a queue admin.

Exception: In the simple case of having only one template file in the branch and one entry in Launchpad Translations, these two are always matched and the translation domain attribute of the Launchpad Translations entry is updated with whatever the file name provides. The template name is never updated as it identifies the template in the UI and is also used in URLs.