Pootle as a PO file repository

From Apache OpenOffice Wiki
Revision as of 08:33, 1 February 2008 by Rail (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

As you know Pootle can be used as a online translation tool. But it also supports basic download and upload operations even using Zip archives. I want to describe how to use Pootle as a PO file repository for offline translation. To ease change tracking in local files we will use Git.

To download the entire UI or HC2 translation you need to have "archive" privileges. After logging in and switching to editor mode you can see "Download Zip of folder" in the root folder of UI or HC2. Follow the link and get the file to your computer. In my case I downloaded the file into /home/rail/work/ooo/QA/3.0 folder.

Unzip the file into po folder:

   unzip openoffice_org-tr.zip -d po

Now we should create local Git repository and import initial files:

   cd po
   git init-db
   git add .
   git commit -m "Initial import"

To ease our work we create a tag for initial import:

   git tag initial

Now we are ready to start the translation process using our favorite PO editor (Kbabel or Emacs with po-mode :) ). Time by time commit your work into local repository.

When you feel that you are ready to upload your changes to Pootle (online PO repository ;) ) you need to prepare Zip file with changed files. First of all, commit your latest changes into your Git repository:

   git commit -m "ready to go"

I use the following one liner to create needed zip file with changed files:

   zip -r ../openoffice_org-tr-changed.zip `git diff initial HEAD |grep '^--- a' |sed 's/^--- a\///'`

Upload the Zip file via Pootle interface (upload privileges needed). Don't forget to choose merge or replace method. Merge method will try to merge untranslated messages, but changed messages will be added as suggestions. So you need to walk through them after. Choose replace if you are sure that there was no changes in Pootle since initial download.

Note: upload process can take some time, sometimes a lot. Seems like Pootle tries to re-index the files on the fly (FIXME). If you have some problems with uploading you can send the changed files to Pootle admin (Aijin) and kindly ask her to upload your files via file system. :)

Personal tools