Translate Toolkit & Pootle

Tools to help you make your software local

User Tools


Tips from the trench

These tips have been written with Pootle versions up to 1.2 in mind and things might not be the same in newer versions of Pootle.

Easy term searches in Opera

In Opera, you can select a word by double-clicking it, and it will also pop up a context menu. One of the options is “Search” and you can create a customised search in Opera that will appear on that menu. You can add the Pootle term search on it, too. Here's how:

1. Right-click inside a text box.

2. Select “Create search”.

3. Name the search “Pootle:Pigdin” (if you're going to search pidgin, for example)

4. Click “Details” and add the following URL:

http://pootle.translate.org.za/af/pidgin/translate.html?searchtext=%s
(or similar, depending on where your Pootle server is).

5. Click “POST”.

6. Press Okay, and hey presto, you have a search function for Pootle in Opera.

To do a search, highlight any word or words, right-click and select Search → Pootle:Pidgin. Interestingly, if you're doing the search from the same page as you would normally do the search, you can simply select Search and Opera will know to use the Pootle search.

Easy adding terms to Pootle's glossary

Did you know you can add terms to pootle-terminology.po without having to upload the entire file every time? Simply create a file named pootle-terminology.po with the single term in it (in PO format, obviously), and upload it as usual. If it is a new term, Pootle will add it. If it is an existing term, Pootle will do what you specify (update etc). I think this only works if you're the administrator…

AutoIt script for adding terms

I've written a small AutoIt script that runs on MS Windows. It adds terms in PO format to a file that can be uploaded to your Pootle glossary. It is primitive, but it works for me.

pootle-addterm_1_2.zip (now with comment support)

How it works:

  1. At the start, type in the name of your pootle-terminology.po file or similar. The terminology file will be created in the same directory as the script.
  2. To use, simply select source term in any application, and press Ctrl+Alt+T.
  3. Then select the target term in any application, and press Ctrl+Alt+T again.
  4. You'll be prompted to confirm or make changes (such as removing spaces or punctuation), and then click OK.

The terms will be prompted in this format:

[source][target]

and will be written to the glossary in this format:

msgid "source"
msgstr "target"
  • You can also add comments. When prompted to check your terms, simply add the comments in a third pair of brackets:
[source][target][comments]

which will be written to the glossary in this format:

# comments
msgid "source"
msgstr "target"

If you have admin rights on Pootle, you can regularly upload the glossary. If you're running Pootle on your own machine, you can put the script and the glossary file in the usual place and Pootle will recognise any new terms almost immediately (also see next note).

New files not recognised when running local?

If you're running a local copy of Pootle (say, in MS Windows), and you add a new PO file to the /po/nn directory (where nn is your language code), you have to restart the Pootle server before Pootle will recognise the new file. Alternatively, you can make use of Pootle's file upload feature, in which case Pootle should recognise the file immediately. This is especially relevant when you add a new terminology PO file to an existing, running project.

Be careful when uploading zipped files

Some zip programs create a folder inside the zip file with the same name as the zip file. If you upload such a file, Pootle might create a folder with the zip file's name.

So if you zip up your files a.po, b.po and c.po into a zip file called “abc.zip”, make sure the zip structure is this:

abc.zip/a.po
abc.zip/b.po
abc.zip/c.po

and not this:

abc.zip/abc/a.po
abc.zip/abc/b.po
abc.zip/abc/c.po