Aller au contenu. | Aller à la navigation

Outils personnels


Vous êtes ici : Accueil / Articles / My translation doesn't show up in Plone 4

My translation doesn't show up in Plone 4

Par Vincent Fretin publié 25/03/2010 09:45, Dernière modification 14/09/2010 08:23
I explain what changed in Plone 4 regarding the po compilation.

I see people complaining about translation that is not working in Plone 4.

In Plone 4, PlacelessTranslationService now uses zope.i18n. The i18n and locales directories use the same catalog engine.

In Plone 3, PlacelessTranslatiService took care of compiling the po files. But in Plone 4 it is not the case anymore.

If you want the same behavior, you can give an option to zope.i18n like this in your buildout.cfg:

# ...
environment-vars =
    zope_i18n_compile_mo_files true

I updated ZopeSkel to include this option when you create a buildout for Plone 4. The change will be in ZopeSkel 2.17.

If you didn't know, to create a Plone 4 buildout, you use the plone3_buildout template. If you give a version beginning with a 4 (4.0b1-1 for example), you have something completely different than a Plone 3 buildout.

And if you wonder why when you don't have the option enabled, Plone translations show up but not the third party one. Well it's simple, I include the mo files in the package when I release it.

It's not a good idea to have mo files subversioned, but having mo files in the archive (if you compile them just before releasing the package) can resolve here some permission issues. For example the user starting the Plone instance may not have the permission to write to the package directory.