Home

i18n and plone

Updated:
Created:
i18n, plone

How to do i18n related tasks in plone

A little i18n cookbook

• Build a pot file

~/projects/piraten/opinion/bin/i18ndude rebuild-pot --pot locales/Products.opinions.pot --create Products.opinions .
• Copy the files to

locales/de/LC_MESSAGES/Products.opinions.po

files

• Get them translated, using poedit, which when saving will create .mo files

• Activate the translations in the products configure.zcml file

<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:five="http://namespaces.zope.org/five"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="Products.opinions"
xmlns:i18n="http://namespaces.zope.org/i18n"
>
<i18n:registerTranslations directory="locales"/>
...
• Merge in new translations by a) rebuilding the pot file, and b)

 ~/projects/piraten/opinion/bin/i18ndude sync --pot locales/Products.opinions.pot locales/*/LC_MESSAGES.Products.opinions.po

Overriding translations

When overriding a message file from an old Product with an  i18n directory, you can use your new locales directory, but make sure to rename the .po file accordingly. E.g:

Products/Ploneboard/i18n/Ploneboard-de.po

becomes

my.product/my/product/locales/de/LC_MESSAGES/ploneboard.po

'ploneboard' is the name of the domain that is used in the file. The file doesn't override the old file completely - only the messageids that are in the new file get used, for the other ones the old file is still relevant.