Personal tools
You are here: Home Reinout van Rees' weblog Load only the languages you need with PTS

Load only the languages you need with PTS

by Reinout van Rees — last modified Jun 30, 2008 03:56 PM
Filed Under:

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).

Document Actions