LinguaPlone 0.7 released!
Plone has excellent support for multilingual user interfaces, and Plone Solutions is happy to announce LinguaPlone, a product that makes multilingual content in your Plone site easy to manage and translate.
LinguaPlone 0.7 requires the following products to work:
- Recent PloneLanguageTool release from the Collective
- Recent Archetypes 1.3 Release Candidate from the Collective
- Recommended: Recent release of PlacelessTranslationTool from the Collective.
- Recommended: Recent release of ATContentTypes for multilingual support in the standard Plone content types.
- Plone 2.0.3 or newer
LinguaPlone is released under the LGPL license.
LinguaPlone is a 3rd generation multilingual/translation solution for Plone. It attempts to be as transparent as possible and minimize the impact for existing applications and Plone itself.
It utilizes Archetypes references to keep track of translations, and all content is left intact both on install and uninstall - thus, it will not disrupt your content structure in any way. It also works with WebDAV and FTP.
LinguaPlone doesn't require a particular hierarchy of content, and will work with any layout of your content space.
Some benefits of LinguaPlone
- Totally transparent, install-and-go.
- Each translation is a discrete object, and can be workflowed individually.
- This also means that it works with WebDAV and FTP.
- Translations are kept track of using AT references.
- You can multilingual-enable your types without affecting their operation outside LinguaPlone.
- Even if you uninstall LinguaPlone after adding multilingual content, all your content will be intact and will work as separate objects! The only thing that will be inactive is the references between the objects. If you re-install it, they will be back. It's very non-intrusive.
- Supporting multilingual capabilities is a 4 (!) line addition to your Archetypes class, and does not alter the functionality of the class when used outside LinguaPlone.
- Fully integrated with ATContentTypes, so the basic content types are translatable.
- Supports language-independent fields (example: dates, first/last names) for fields you want to be the same across translations, and updated in all languages if one of them changes.
- Uses the notion of Canonical versions, so you can do interesting things with workflow, like invalidate all translations of a document when the master copy has changed.
LinguaPlone - quick demo instructions
LinguaPlone ships with a few example types that demonstrates the translation mechanism. It's trivial to add this to your own classes (see the README), but to save you the hassle, you can try this simple experiment:
- Make sure you have Archetypes from the 1.3 branch installed, preferably release candidate 2 or 3. LinguaPlone will not work with the default AT version shipping with Plone 2.0 either. The target version for LinguaPlone is Plone 2.1 and Archetypes 1.3.
- Put LinguaPlone and PloneLanguageTool in your Products directory
- (Re)start Zope
Add/Remove Products, install Archetypes, LinguaPlone and PloneLanguageTool
You will now have a few extra example types to play with. For the demonstration to make sense, we need to define a list of languages, though:
- Go to the ZMI of your Plone instance
- Select 3-4 languages from the selection list. Note that the languages are listed in their native name, so the sorting might be a bit unexpected (Spanish is EspaÒol, for example)
Now we have a few languages to play with, and can go back to the Plone interface. Notice how you now have flags indicating your selected languages under the print/sendto area.
There is still a portlet on the left hand side that performs the same function, this will be an optional feature when LinguaPlone is released.
We now want to add a simple type:
- Add a
This is a multilingual-enabled content type that shows off a few of the unique features of LinguaPlone, eg. language-independent fields.
- After filling out the type with some content and clicking
Save, you will see that this content type has a pulldown menu,
- Select a language you want to translate this document into.
- Save this translation.
- Try to switch languages by clicking the flags.
That's a very simple use case for the multilingual types. If you switch to the folder contents view, you will see that they are individual objects.
You can test it by multilingual-enabling your existing AT content types
(see instructions below), or by testing the simple included types.
Don't forget to select what languages should be available in
in the ZMI. :)
LinguaPlone can only be used with Archetypes based content types. It provides a I18NBaseObject class that implements a ITranslatable interface that handles the translation linking. LinguaPlone provides base classes that inherits from I18NBaseObject and the regular AT base classes.
Language independent fields
Language independent fields are looked up from the canonical (original) translation.
The value is also stored on each translated object so every object has every attribute in case it is moved out of a translation context or some attributes (like start and end on Events) are referenced directly.
Language independence is set in the AT schema definition. Only AT based content types can have language independent fields.
The language tool returns a list of languages to look for. If there is no fallback, there will be only one element in the list.
Enable i18n in your content types
At the top, instead of
import * from Archetypes.public, you add:
try: from Products.LinguaPlone.public import * except ImportError: # No multilingual support from Products.Archetypes.public import *
For the fields that are language independent, you add
in the schema definition.
To do before 1.0 release
- LanguageIndex to to support fallback in catalog searches if fallback is turned on in PLT
- Enable language aware references tool to enable linking to canonical and retrieval of correct translation
- Make browserDefault language aware
- Add ITranslatable interface to Plone
- File and image fields need special attention when language independent. If you create content, upload file, then create a translation the file is not copied over to the translation, and will not be copied over when saving, like other fields will. Can either sync on save or copy everything over when creating the translation. Accessor lookup should work as normal.
- Folder contents should be language aware
- The flags should be grayed-out when the language is not available, but you can switch to it.
If a field is languageIndependent in a base class, but not in a class inherited from the base class, new mutators will not be generated for the inheriting class. Basically you can't remove the language independence from a base class, but you can add it.
LGPL, see license.txt
LinguaPlone is developed and maintained by Plone Solutions
Initial idea/architecture and general help by Kapil Thangavelu and Benjamin Saller of Object Realms