Posts Tagged ‘plone’

Plone cookies, a little Christmas gift from Plone.org

Wednesday, December 24th, 2008

Plone is the CMS that we use at SEMIC Internet to develop websites and projects.

The guys from plone.org have tested and tasted a new plone cookies that look interesting, recipe included.

Merry Christmas and a Happy New Year to everybody.

Plone cookie

Plone cookie

How to create i18n translations in Plone 3 themes

Sunday, November 9th, 2008

In this article I will explain how to create a Plone 3 theme basic skeleton and then, create i18n translation files to use them in our templates, in the Zope 3 way.

First step is to create the theme in the ZopeSkel way:

paster create -t plone3_theme plonetheme.yourtheme

Now, assuming that you already know how to create the Plone templates, let’s make the basic folder structure for i18n translation files, for example, we are gonna create English and Catalan translation for our template.

Edit the main configure.zcml file and add this line:

<i18n:registerTranslations directory=”locales”/>

By doing this, you are indication Plone to search translations inside locales folder, so now lets create the folders structure necessary for our .po/.mo files.

Inside /locales, we need a folder containing the code of every language we want to create translations for, and inside them the LC_MESSAGES containing .po/.mo

/plonetheme.yourtheme
/plonetheme.yourtheme/locales/plonetheme.yourtheme.pot
/plonetheme.yourtheme/locales/en/LC_MESSAGES/plonetheme.yourtheme.po
/plonetheme.yourtheme/locales/es/LC_MESSAGES/plonetheme.yourtheme.po

Now we need to manually compile the .po files into .mo, because doing the translations in this way, Zope does not compile .po files in startup, so now, using msgfmt…

msgfmt -o plonetheme.yourtheme.mo plonetheme.yourtheme.po
msgfmt -o plonetheme.yourtheme.mo plonetheme.yourtheme.po

Plone will find now the translations and we can use them in our templates, to do that, we have to indicate the correct i18n domain in templates

<div i18n:domain=”plonetheme.yourtheme”>

That’s all! it works, seriously :)

World Plone Day, November 7th 2008

Wednesday, November 5th, 2008

Plone, one of the best Open Source CMS, is celebrating its day this November 7, a lot of activities are planned in different cities all around the world in order to promote, meet and discover the possibilities of this software in goverment, business and education.

If you are new or you don’t know anything about Plone, take some time and give it a try, yes it’s one of the hardest to develop, but once you get in… it’s harder to get out!

I’m working with Zope/Plone in SEMIC Internet, so following the open source community spirit, we are goint to sponsor WPD too and maybe doing something in Lleida.

Link: World Plone Day at Plone.org

POSKeyError in Zope when trying to copy a site to a new filesystem

Sunday, August 17th, 2008

Some days ago I had to move a Plone Site from one filesystem to another, both in the same Zope instance in a linux PC with Zope 2.10.6-final, python 2.4.5, and Plone 3.1.2

Everything seemed to go well, I made a cut/paste from an entire Plone Site that was in the main Data.fs because I needed to put in another database, called Data-sitename.fs and after that, the site worked perfectly, but… some hours later I made a database pack in order to clean all the Plone instances removing old objects.

Just after pressing the pack button in the new Data-sitename.fs, ups! something went wrong:

Error Type: POSKeyError
Error Value: 0x484b

As a result of that, the new Data-sitename.fs was corrupted and the Plone Site inside was gone :(

Be careful! do not cut or copy/paste a Plone Site from a filesystem to another one in the same Zope, instead of that, do a Export/Import and it will work :)