PlacelessTranslationService bit my head off!

Published: 2007-08-09 16:34 UTC. Tags: open source software plone
Today, I made the mistake of adding a <myproductname>-sv.po file in the i18n directory of my product, which accidentally were marked with
Language: en

This of course made the english strings appear in swedish, but that's only to expect. What happened then was worse - after correcting the file to contain:

Language: sv

..there were no change! The english strings still appeared in swedish!

After a frustrated debug session, it turns out that the language property of the GettextMessageCatalog object stored in the ZODB (I think) is not reloaded when the Language property in the file is changed. So, even if you change the Language line in the .po file, the translation will still be marked as being in the language it first was entered as.

The solution? Move the .po-file out of the i18n directory, restart Zope, then move it back, and restart again.

Gah!

Well, at least I can be glad that my CMS is an open source product, allowing me to debug problems properly.


←← previous blog entry next blog entry →→

Comment by Tiberiu Ichim

Created Thu, 9 Aug 2007 15:59:26 +0000

I've solved it that time by deleting the message catalog from the PTS zope configlet in the Control_Panel

Comment by Kai Diefenbach

Created Thu, 9 Aug 2007 16:28:50 +0000

I think you can also browser to /Control_Panel/TranslationService/<your-po-file> and "Reload this catalog". At least you can delete it here and restart Zope.

Kai

Comment by Hanno Schlichting

Created Sat, 11 Aug 2007 16:11:34 +0000

PTS itself is scheduled for deletion, as especially the whole concept of having persistent catalogs has been quite painful. In Plone3 you can use the simple Zope3 locales folder structure instead and PTS won't be used at all for your translations anymore :)

Comment by Karcheg

Created Fri, 27 Feb 2009 03:33:37 +0000

Hmm, very cognitive post.
Is this theme good unough for the Digg?

Post a comment

Posting of comments have been disabled for now. Too much spam.