Pybackpack Translation Workflow

Introduction

Pybackpack uses a system called gettext to enable strings in its source code to be translated into many languages. The strings are likely to change during a release cycle, so translations need to be kept up-to-date. This guide describes a workflow which translators can use to keep their translations current and which hopefully makes it easy to do so.

Method 1: Use Transifex

Head over to the  Pybackpack page on transifex.net. More details can be found in the transifex FAQ. If you don't want to sign up to transifex, use Method 2.

Method 2: Get The Source

To work on the latest translation template so that translations are up-to-date at release time, it is recommended to work with the translation templates from the subversion repository. To download the latest state of the subversion repository, do:

svn co https://projects.sucs.org/svn/backuptool/trunk pybackpack-svn

Alternatively, if you only care about one existing translation, you can download the corresponding .po file from  http://projects.sucs.org/svn/backuptool/trunk/po/ but note that you should do this every time you begin translating to stay up-to-date. See below for a description of what .po files are.

Translating

In the pybackpack-svn/po/ directory you will find several .po files and a pybackpack.pot file. The .po files are existing translations and the pybackpack.pot file is the latest translation template which new translations are based on.

Beginning a new translation

If the .po file in your language does not exist yet, copy the pybackpack.pot file to a file called LOCALE.po, where LOCALE is the code of your language, e.g. en_GB.po or it.po. Edit the header information in the new file to show that you are the first contributor and to show what language it is.

Continuing to translate

Now that your .po file exists, you are ready to do some translating. There are several methods for doing this. You can use a plain text editor to translate each line beginning with msgid and entering the translation into the msgstr line below it, but some prefer to use a graphical translation tool such as  poedit (the  screenshots will give you an idea of how it works).

Testing

To test your translations without installing pybackpack, you can use the test-trans.sh script in the po directory like so:

cd pybackpack-svn/po
./test-trans.sh it.po

Where it.po is the file containing your translations.

The first command changes into the po directory and the second command compiles your translations into a temporary directory and then launches pybackpack using your translations. The script does not alter your translations file in any way and it does not interfere with any previous installations.

If you want to test translations for a different locale you will have to replace the second command with something like:

LC_ALL=it_IT.UTF-8 ./test-trans.sh it.po

Where it_IT.UTF-8 is the locale you want to use to test the translations.

Stay Up-to-date

It is important to stay up-to-date with the latest state of the translations in pybackpack, so you should run this command from your pybackpack-svn directory regularly (each time you begin working on your translations):

svn update

If there have been changes to the strings since the last update, the new strings will have been merged into the .po file of your language to be translated.

Submitting translations

To submit your translations send your .po file, as an attachment, to the pybackpack mailing list, pybackpack@…

As pybackpack's strings are likely to change during development you should  subscribe to the mailing list to keep up-to-date.