Load only the languages you need with PTSΒΆ

Tags: plone, buildout

Plone is translated into a whopping amount of languages. Many add-on products also sport at least a few translations. This is all handled by zope's PlacelessTranslationService (PTS).

When starting up, all those translation files are loaded and information about them is stored in the zodb. That takes time and memory. A recent PTS release (at least included in plone 3.1.1) added a nifty trick to reduce that footprint in case you don't need those languages: a PTS_LANGUAGES=en,nl environment variable would make PTS use on the Dutch and English.

In case you use buildout, add the following to your instance part:

 [instance]
 recipe = plone.recipe.zope2instance
 ...
 environment-vars =
     PTS_LANGUAGES en, nl

I just discovered it in some mailinglist message last week and tried it out today. Great little feature. (Note that it seemed to want a comma AND a space when I tested it locally, might be a bug).

 
vanrees.org logo

About me

My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.

Weblog feeds

Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):