GC3: Grid Computing Competence Center

Since July 1st, 2014, GC3 merged into S3IT.
This web site is only kept for historical reasons and may be out-of-date.
Visit the S3IT website for more up-to-date information.

Blog index

GC3 graudates into S3IT
Posted early Tuesday morning, July 1st, 2014
How to create a module that also load a virtualenvironment
Posted mid-morning Friday, March 7th, 2014
Openstack workshop at GC3
Posted mid-morning Saturday, February 22nd, 2014
Moving LVM volumes used by a Cinder storage
Posted Friday evening, February 21st, 2014
How to configure swift glusterfs
Posted Monday night, February 10th, 2014
Fixing LDAP Authentication over TLS/SSL
Posted Monday night, January 6th, 2014
Linker command-line options for Intel MKL
Posted late Saturday evening, January 4th, 2014
A virtue of lazyness
Posted Saturday afternoon, December 21st, 2013
(Almost) readable CFEngine logs
Posted Thursday afternoon, December 19th, 2013
CFEngine error: ExpandAndMapIteratorsFromScalar called with invalid strlen
Posted at lunch time on Wednesday, December 11th, 2013
'Martian source' log messages and the default IP route
Posted Monday afternoon, November 25th, 2013
GC3 takes over maintenance of the Schroedinger cluster
Posted mid-morning Monday, November 4th, 2013
Grid Engine: how to find the set of nodes that ran a job (after it's finished)
Posted terribly early Wednesday morning, October 30th, 2013
Python2 vs Python3
Posted Friday afternoon, September 13th, 2013
GC3Pie 2.1.1 released
Posted at teatime on Friday, September 6th, 2013
Happy SysAdmin day!
Posted early Friday morning, July 26th, 2013
Object-oriented Python training
Posted at lunch time on Thursday, July 25th, 2013
Elasticluster 1.0.0 released
Posted late Thursday evening, July 18th, 2013
Short Autotools tutorial
Posted mid-morning Friday, July 5th, 2013
Patch Emacs' PostScript printing
Posted late Tuesday afternoon, June 11th, 2013
Slides of the Object-oriented Python course now available!
Posted late Tuesday afternoon, June 11th, 2013
Compile an Objective-C application on Ubuntu (Hobbes instance)
Posted late Friday afternoon, May 31st, 2013
Automated deployment of CFEngine keys
Posted Thursday night, May 30th, 2013
blog/Resize_an_image
Posted late Tuesday afternoon, May 14th, 2013
Join us at the Compute Cloud Experience Workshop!
Posted early Monday morning, April 29th, 2013
GC3 Beamer theme released
Posted mid-morning Friday, April 5th, 2013
VM-MAD at the International Supercompting Conference 2013
Posted late Tuesday morning, March 26th, 2013
The GC3 is on GitHub
Posted late Monday morning, March 18th, 2013
How to enable search in IkiWiki
Posted Friday afternoon, March 15th, 2013
GC3Pie Training
Posted Thursday night, March 7th, 2013
Object-oriented Python training
Posted Thursday afternoon, March 7th, 2013
Advance Reservations in GridEngine
Posted mid-morning Thursday, March 7th, 2013
GridEngine accounting queries with PostgreSQL
Posted Wednesday night, March 6th, 2013
Floating IPs not available on Hobbes
Posted Tuesday afternoon, February 26th, 2013
Notes on SWIFT
Posted early Tuesday morning, February 12th, 2013
An online Python code quality analyzer
Posted late Saturday morning, February 9th, 2013
Seminar on cloud infrastructure
Posted Sunday night, February 3rd, 2013
GC3 announce its cloud infrastructure Hobbes
Posted at lunch time on Wednesday, January 30th, 2013
GC3Pie 2.0.2 released
Posted Monday afternoon, January 28th, 2013
Continuous Integration with Jenkins
Posted late Saturday morning, January 26th, 2013
On the importance of testing in a clean environment
Posted early Monday morning, January 21st, 2013
Weirdness with ImageMagick's `convert`
Posted Tuesday afternoon, January 15th, 2013
boto vs libcloud
Posted Tuesday afternoon, January 15th, 2013
Resolve timeout problem when starting many instances at once
Posted late Monday morning, January 7th, 2013
Proceedings of the EGI Community Forum 2012 published
Posted Monday afternoon, December 17th, 2012
SGE Workaround Installation
Posted at noon on Tuesday, December 4th, 2012
How to pass an argument of list type to a CFEngine3 bundle
Posted early Thursday morning, November 22nd, 2012
GC3 at the 'Clouds for Future Internet' workshop
Posted early Wednesday morning, November 21st, 2012
GC3 attends European Commission Cloud Expert Group
Posted early Monday morning, October 29th, 2012
SwiNG - SDCD2012 event
Posted mid-morning Monday, October 22nd, 2012
Large Scale Computing Infrastructures class starts tomorrow!
Posted Tuesday afternoon, September 25th, 2012
From bare metal to cloud at GC3
Posted early Monday morning, September 24th, 2012
GC3 at the EGI Technical Forum 2012
Posted late Thursday evening, September 20th, 2012
Training on GC3Pie and Python
Posted Friday evening, September 7th, 2012
GC3Pie used for research in Computational Quantum Chemistry
Posted Thursday afternoon, September 6th, 2012
``What's so great about MPI or Boost.MPI?''
Posted early Thursday morning, September 6th, 2012
blog/How to generate UML diagram with `pyreverse`
Posted early Thursday morning, August 23rd, 2012
Git's `rebase` command
Posted early Friday morning, June 15th, 2012
AppPot 0.27 released!
Posted mid-morning Thursday, June 14th, 2012
Urban computing - connecting to your server using `mosh`
Posted early Wednesday morning, June 6th, 2012
Whitespace cleanup with Emacs
Posted at lunch time on Tuesday, June 5th, 2012
Translate pages on this site
Posted late Thursday afternoon, May 31st, 2012
Scientific paper citing GC3Pie
Posted at teatime on Wednesday, May 30th, 2012
GC3 attends Nordugrid 2012 conference
Posted mid-morning Wednesday, May 30th, 2012
How the front page image was made
Posted Wednesday evening, May 16th, 2012
GC3 blog launched!
Posted Tuesday evening, May 15th, 2012
New GC3 Wiki now online!
Posted Tuesday afternoon, May 15th, 2012
AppPot paper on arXiv
Posted Tuesday afternoon, May 15th, 2012
GC3 at the EGI Technical Forum 2011
Posted Tuesday afternoon, May 15th, 2012

More on topic...

How to translate web pages on this site

The GC3 website now features a German language translation of the main pages (many thanks to Heidi Weber who provided the translated text!); this blog post discusses how to add new translations of other pages and modify existing translations.

An introduction to IkiWiki's handling of multi-lingual pages

IkiWiki uses the po4a software to serve multi-lingual pages. The basic idea of po4a is to use GNU gettext to provide translations of every text string contained in a web page; the translated strings are plugged back into the existing page structure.

In more detail, for each wiki page that ought to have a translation:

  1. IkiWiki extracts text strings from the source page (written in the so-called master language, which is English in our case); the catalog of extracted strings is written to a .pot file (PO template)

  2. Reads the translation of each text string from the translation catalog stored in .po files. The translation catalog for German is called .de.po; the one for Italian is .it.po, etc. -- It's always the language code, followed by .po.

    If no translation is available (either the relevant .po file does not exist, or the translated string is empty), then the master language string is used unchanged.

  3. The translated strings are then substituted back into the content to be served, replacing the master language ones.

  4. IkiWiki provides a link to every translation of the current page; in our web site, these are visible in the upper right corner.

I would like to emphasize that this system promotes separation of structure (which comes from the master language page), and content (which comes from .po files except for the master language). This might somewhat overkill in our case, however, since most of the site content is written in the lightweight markup language Markdown (so there's not much structure to preserve).

How to update an existing translation

When editing online (i.e., with IkiWiki's web edit form), you will be presented with the content of the .po file in the TEXTAREA box.

When editing offline, locate the .po file corresponding to the web page and language that you want to edit: append the language code and .po to the name of the web page. For instance, the German translation of the about page is stored in file about.de.po.

The following section describes .po files and how to edit them.

How to edit .po files

A .po file is a sequence of msgid and miscast directives:

  • a msgid directive specifies the string to be translated, enclosed in double quotes (");
  • the msgstr directive immediately following provides the translation.

Blank lines and lines starting with the has character # are ignored.

For instance, the following pair (taken from the index.de.po file) translates the title of the front page:

    msgid "Welcome to GC3, the Grid Computing Competence Center"
    msgstr "Willkommen beim GC3, dem Grid Computing Competence Center"

If a translated string contains quote characters ("), then they should be escaped with a backslash (\"), as in the following example:

    msgid  "<a href=\"projects.html\">Collaboration</a>"
    msgstr "<a href=\"projects.html\">Kollaboration</a>"

Text strings (both for msgid and msgstr) may not extend over multiple lines, but multiple quoted strings are concatenated. For instance, the following stanza is exactly equivalent to writing msgid followed by "Enabling scientific applications on Grid and Cloud infrastructures is our main focus." and a msgstr followed by "Unsere Hauptaufgabe besteht darin, wissenschaftliche Anwendungen auf Grid und Cloud Infrastrukturen zu ermöglichen."

    msgid ""
    "Enabling scientific applications on Grid and Cloud"
    " infrastructures is our main focus."
    msgstr ""
    "Unsere Hauptaufgabe besteht darin, wissenschaftliche Anwendungen auf Grid"
    " und Cloud Infrastrukturen zu ermöglichen."

This multi-line format should be used for paragraph-long strings. I think that putting whitespace at the beginning of continuation lines enhances readability: it emphasizes that a line really is a continuation of the above one.

Finally, an empty string ("") after msgstr specifies that the string should be kept as-is, i.e., is not changed in the translated page:


        msgid "[[!inline pages=\"tagged(news)\" postform=\"no\" show=\"5\" rss=no archive=yes]]"
        msgstr ""

This should be used, as in the example above, when the PO4A software mistakes an IkiWiki directive for text to be translated.

How to add a translation to an English-only page

Steps for adding a translation to a page basically entail creation of a translation "template" (a .pot file); after that, translation proceeds as above.

As an illustration, we shall walk through the steps needed to add a German translation of the impressum page.

1. Add the page to the list of "translatable" pages

Only pages listed in IkiWiki's po_translatable_pages configuration setting are processed for translated content. (This is done to reduce clutter on the file system, as most content on the site is English-language only.)

So the first step is to edit the /srv/www/gc3wiki/ikiwiki.conf file and add the new page to po_translatable_pages: its value is an IkiWiki PageSpec, read http://ikiwiki.info/ikiwiki/pagespec/ for details on the syntax.

This change should be done both to the local.conf file (for locally testing changes) and to the ikiwiki.conf file (for actual deployment on http://www.gc3.uzh.ch/).

For example, to add the impressum page, one would update the line:

    po_translatable_pages => 'index or about',

to read instead:

    po_translatable_pages => 'index or about or impressum',

2. Refresh the Wiki to create the translation template

Refreshing the wiki content will (silently) create a .pot file corresponding to the page to be translated in the wiki directory.

    $ ./local.conf --refresh
    refreshing wiki..
    ...
    building impressum.mdwn
    ...

    $ ls wiki/
    ...
    impressum.pot
    ...

As usual, you should do the work on a local working copy, and only push to the master repository when everything is fine. So the above commands assume that a local working copy has been set up as in the offline editing page.

The .pot file should be added to the SVN repository:

    $ cd wiki/
    $ svn add impressum.pot

3. Create the initial PO file

Copy the .pot file to the .po file corresponding to the translation language.

PO files are named after the page they translate, followed by the 2-letter language code, and the suffix .po. For instance, the German translation of the impressum page is named impressum.de.po:

    $ cd wiki/
    $ cp impressum.pot impressum.de.po

Do not forget to track the .po file in SVN:

    $ svn add impressum.pot impressum.de.po

4. Translate!

Edit the PO file according to the instructions in section How to update an existing translation above.

5. Push your changes to the ocikbapps web server

Commit all your local changes to the SVN repository.

The configuration change must also be committed (otherwise IkiWiki ignores translations of the page), but there's no automatic update following a configuration change, so we should effect it "by hand". Log in to ocikbapps and execute the following:

    $ cd /srv/www/gc3wiki
    $ sudo svn update # should update `ikiwiki.conf`
    $ sudo -u www-data ./ikiwiki.conf --refresh # rebuild site

Further reading

--RM

top