Diff for "Translations/YourProject/ImportingTemplates"

Not logged in - Log In / Register

Differences between revisions 7 and 14 (spanning 7 versions)
Revision 7 as of 2009-08-11 16:02:29
Size: 6522
Editor: 92-237-59-186
Comment:
Revision 14 as of 2010-02-04 17:31:48
Size: 7610
Editor: cpc3-wolv12-0-0-cust183
Comment: page was renamed from Translations/ImportingTemplates
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from Translations/ImportingTemplates
## page was renamed from Translations/Lao/ImportingTemplates
## page was renamed from Translations/YourProject/ImportingTemplates
## page was renamed from Translations/YourProject/ImportingTemplates/Draft
Line 14: Line 18:
 * '''recommended:''' automatic and ongoing imports of your templates, and optionally also [[Translations/ImportingTranslations|translation files]], from a Bazaar branch you specify  * '''recommended:''' automatic and ongoing imports of your templates, and optionally also [[Translations/YourProject/ImportingTranslations|translation files]], from a Bazaar branch you specify
Line 45: Line 49:
We can ignore the other option for now, as that's explained in our ''[[Translations/ImportingTranslations|Importing translations]]'' article. We can ignore the other option for now, as that's explained in our ''[[Translations/YourProject/ImportingTranslations|Importing translations]]'' article.
Line 69: Line 73:
== Automatic approval == == Ensuring a successful import ==

You can help ensure your files are imported by checking that:

 * there isn't already a translation effort in Launchpad for that project
 * you have permission from the upsteam project, if that's not you
 * for uploads through the web interface, you upload templates in a tarball, so the system can see what directories you want them in; give each template its own directory.

There are also some common problems that can cause a template file import to fail:

 * Make sure each of the message IDs -- i.e. the English strings -- is unique.
 * Use real English strings -- for example ```Save the file``` -- rather than identifiers, such as ```save_msg_z339```.

Launchpad will email you to let you know if your import is a success or a failure.

=== Automatic approval ===
Line 96: Line 115:
||<tablestyle="width: 100%;"> ~-[[Translations/YourProject|< Translation your project]] -~ ||<style="text-align: right;"> ~- [[Translations/YourProject/ImportingTranslations|Importing translations >]] -~ || ||<tablestyle="width: 100%;"> ~-[[Translations/YourProject|< Translating your project]] -~ ||<style="text-align: right;"> ~- [[Translations/YourProject/ImportingTranslations|Importing translations >]] -~ ||

Launchpad Help > Translations Your Project > Importing templates

Importing your project's translation templates

Before anyone can help translate your project, you need to tell Launchpad which English strings appear in your software's interface.

You do this by importing one or more GNU gettext .pot template files. If you're unfamiliar with .pot files or GNU gettext in general, see the gettext manual.

You can choose from two methods of importing translation templates:

Push the branch to Launchpad

You can run concurrent separate translation efforts for each series of your project. For now, let's work with the trunk series that Launchpad created by default when you registered your project.

If you've already set a default branch for your trunk series, you can skip straight to Enabling automatic template imports.

Step 1: Open a terminal and change directory to your Bazaar branch.

Note:

Don't worry if your Bazaar branch is empty. If you're new to Bazaar and Launchpad Code Hosting, see our quick-start.

Step 2: Push your Bazaar branch to Launchpad:

bzr push lp:~your-id/your-project/trunk

Of course, you need to replace the relevant parts of that line with your own Launchpad user id, the project name and, if it isn't trunk, the series name.

Once Bazaar has pushed the branch to Launchpad, Launchpad will automatically associate it with the trunk series.

Enabling automatic template imports

Now you need to tell Launchpad to automatically import any translation templates, and subsequent changes to those templates, that it finds in the series' default branch.

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

Step 2: Next, select Import template files, then click Save settings.

We can ignore the other option for now, as that's explained in our Importing translations article.

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.

Important:

You should follow our translations import policy when creating and adding your templates.

Naming templates

Since a template file does not carry any metadata, all information about it must be derived from its path.

Launchpad needs this metadata 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).

Ensuring a successful import

You can help ensure your files are imported by checking that:

  • there isn't already a translation effort in Launchpad for that project
  • you have permission from the upsteam project, if that's not you
  • for uploads through the web interface, you upload templates in a tarball, so the system can see what directories you want them in; give each template its own directory.

There are also some common problems that can cause a template file import to fail:

  • Make sure each of the message IDs -- i.e. the English strings -- is unique.
  • Use real English strings -- for example Save the file -- rather than identifiers, such as save_msg_z339.

Launchpad will email you to let you know if your import is a success or a failure.

Automatic approval

As you'll have seen in our translations import policy, the first time you import a template -- particularly for a project that is new to Launchpad -- we scrutinise it more closely than subsequent imports. Often, this can mean that one of the Launchpad team reviews your template manually.

One of the big advantages of importing templates directly from your series default Bazaar branch is that your templates stand a better chance of automatic approval.

To assure automatic approval, these conditions must be met:

  • The translation domain must be specified in the path (as described above).
  • The resulting template name must either match the name of a template in Launchpad Translations OR

  • If the template is to be added, no template entry must exist in Launchpad Translations that does not have a matching template file in the branch.

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 one of the Launchpad team.

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.

Manual translation template imports

If you prefer, you can also upload your template -- or an archive containing several template files -- through Launchpad's web interface.

Visit your project's translations overview page and click the link for the trunk series.

Next steps

If you're likely to make translations elsewhere, you can have Launchpad automatically import them from the same Bazaar branch.

< Translating your project

Importing translations >

Translations/YourProject/ImportingTemplates (last edited 2013-09-03 15:47:35 by b3df7bea)