Looking under the hood? Interested in a job? Send a mail....

Translating Silva


Life is a foreign language; all men mispronounce it.

- Christopher Morley (1890-1957)

This document is intended to help you getting started with translating Silva into your language. We assume you already have a Silva up and running to test your translations.

Translating using Launchpad

The quickest and most easy way to translate Silva is by using Launchpad.
The link for the Silva project on Launchpad is:
Launchpad provides an easy to use translating tool for Silva which can be found here:

Once finished translating, you can download the .po file. Then you have to generate a binary .mo file, this can be realized using ‘msgfmt’ or a tool like poedit.

Creating and editing translations without Launchpad

Creating the translation file

Base your translation on the silva.pot template file in the i18n directory (located in the Silva product directory), by copying it to a new file in the same directory, using this naming convention:

silva-<language code>.po (eg silva-nl.po)

The .po file is the translation file that will contain your translated strings.

Editing the translation file

Important notice: when working on your translations, verify that you use either a text editor that supports utf-8 and is set to use utf-8 encoding or a po editor (poedit is recommended) before you start editing the .po file – existing translations could get messed up otherwise!

Before you start translating, make sure to update the following header fields in the .po file:

"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: NAME<EMAIL@ADDRESS>\n"

Add the following fields (example for Dutch):

"Language-code: nl\n"
"Language-name: Nederlands\n"
"Preferred-encodings: utf-8\n"
"Domain: silva\n"

And you're ready to go.

Translating strings

The .po file consists of message id (msgid)/message string(msgstr) pairs.  One entry might look like this:

#: /Folder.py:334 /Folder.py:432
msgid "pasting &#xab;${id}&#xbb; is not allowed in this type of container"
msgstr ""
"het plakken van &#xab;${id}&#xbb; is niet toegestaan in dit type container"

The first line is a comment (marked by #:) that indicates from which source file the translatable message originates. The second line is the original content (which should never be modified!), The last line is the msgstr, the actual translation which can be spread out over multiple lines, enclosed by double quotes (see the example); if you want newlines to show up in your translation, use '\n'.

In this example you can also see how dynamic content can be dealt with in the translations: the ${id} marks a variable which will be replaced by the id of the document when it is being shown in the Silva Management Interface.

The last thing noteworthy in this example is that it shows a case where markup in translations could not be avoided: the xml entities (like &#xab;) should be preserved in your translation.

Testing your translations

When you're done adding translations, and wish to test them, you should restart your Zope instance to have Placeless Translation Service pick up your translation file. Make sure the language preferences in your browser are correct, otherwise you will not see your translations!

Getting translations and improvements into Silva

Once you're satisfied with your translations, you can send them to the Silva developers. Contact them via the silva-dev or silva-general mailing lists and they'll be glad to include your translation with the next release of Silva.

You can also contact the silva-dev list if you encounter any problems during the translation process.

Improving existing translations

Make sure you're making changes on the last translation available and also make sure you've read the encoding notice above! To get your improvements into the next Silva release, you can do two things: sending patches (create them using diff -Naur), or sending the entire file .po file and its original. If you're not familiar with the process of creating patches, just send the modified file and the original - the Silva developers will then integrate your changes into Silva.