Multilingual content
Plone supports multi-lingual content using LinguaPlone. Adding multilingual support to your content is surprisingly easy. LinguaPlone defines some extensions to some of Archetypes' internals. By conditionally importing from LinguaPlone instead of Archetypes, you can ensure that you will get the LinguaPlone extensions where available, and still work if LinguaPlone is not installed.
All of ATContentTypes is already LinguaPlone aware. To add LinguaPlone support to RichDocument, all that is needed is to add the following to content/richdocument.py and content/attachments.py :
try: from Products.LinguaPlone.public import * except ImportError: # No multilingual support from Products.Archetypes.public import *
This tries to import LinguaPlone's version of Archetypes' public module, and if it fails, falls back on Archetypes' default version. When LinguaPlone is installed, RichDocument will gain the translate menu and become translatable.
Finally, the two fields displayImages and displayAttachments are actually language-independent - they do not need to be translated. Hence, we set languageIndependent=1 in the RichDocument schema for these fields.