Skip to main content

Manage and maintain multilingual content that integrates seamlessly with Plone.

Project description

Introduction

LinguaPlone aims to be the multilingual/translation solution for Plone, and achieves this by being as transparent as possible and by minimizing the impact for existing applications and Plone itself.

It utilizes Archetypes references to do the translation, 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.

Dependencies

Requires the following minimum versions:

Plone 3.1 and later already include plone.browserlayer.

Installation

If you are using a Plone version before 3.1 you need to install plone.browserlayer in your Plone site. It shows up as ‘’Local browser layer support’’ in the Plone ‘’Add-on Products’ control panel.

If you are upgrading LinguaPlone there may be an upgrade step that you need to do. Please check the manage_upgrades tab in portal_setup (in the Zope Management Interface or ZMI). First do this, then do a reinstall in the ‘’Add-on Products’ control panel.

Frequently asked questions

I see no language flags and switching language does not work

This happens if the cookie language negotiation scheme is not enabled. Look at the portal_languages tool in the ZMI and check if Use cookie for manual override is enabled.

There is no option to select multiple languages in the languages control panel

This happens if plone.browserlayer is uninstalled. To correct this you need to install plone.browserlayer and then uninstall and reinstall LinguaPlone.

LinguaPlone refuses to install

Make sure you have ‘Local browser layer support’ installed first. Unless this is installed you can not install LinguaPlone.

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 Plone 3.0.4 or newer installed.

  • Put LinguaPlone in your Products directory

  • (Re)start Zope

  • ‘Site Setup’ → ‘Add/Remove Products’, install LinguaPlone

For the demonstration to make sense, we need to define a list of languages:

  • Go to the Site Setup

  • Click ‘Language Settings’

  • 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 Espanol, for example)

  • Press ‘Save’

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.

We now want to add a simple type:

  • Add a ‘Page’.

  • After filling out the type with some content and clicking ‘Save’, you will see that this content type has a pulldown menu, ‘Translate into’.

  • 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.

Developer Usage

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 ‘portal_languages’ in the ZMI. :)

Credits

LinguaPlone was donated to the Plone Foundation by Plone Solutions, March 2006.

Design and development –

Jarn (Alexander Limi, Dorneles Tremea, Geir Baekholt, Helge Tesdal, Stefan H. Holek, Wichert Akkerman)

Original design idea:

Object realms (Benjamin Saller, Kapil Thangavelu)

Funding and deployment, initial version:

Oxfam International

Additional funding/sponsorship:

Hitotsubashi University in Tokyo, Centre for New European studies (Jonathan Lewis)

Funding Plone 2.0.x compatibility:

Zope Japan Corporation (Takeshi Yamamoto)

Also many thanks to

Simon Eisenmann:

For doing the hard job of the first implementations (I18NLayer) we had to learn from before doing this.

Learning Lab Denmark:

For contributing and sponsoring the experience needed to build a multilingual solution.

Nate Aune:

For always pushing for the better solution and making us realise LinguaPlone had to be built.

Jodok Batlogg:

For extensive testing, deploying and feedback.

Sasha Vincic:

For testing and expanding and making cool new stuff happen with LinguaPlone, XLIFF import/export in particular.

Implementation details

Architecture

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.

Language lookup

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 multilingual support in your content types

At the top, instead of from Products.Archetypes.public import *, 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 ‘languageIndependent=1’ in the schema definition.

License

GNU General Public License, version 2.1

Changelog

2.2 - July 22, 2008

  • LanguageIndependent fields are now shown in view mode for the translations, so they no longer are editable from the translations, which is how it’s documented to behave. [regebro]

  • Made the upgrade step also work on Plone 3 (GenericSetup 1.3). [maurits]

  • Registered GenericSetup upgrade step to get rid of an old linguaplone_various import step. I registered it for upgrading from 2.0 to 2.1 as that was when this import step was removed. It is always available in portal_setup/manage_upgrades in the ZMI. [maurits]

  • When going to the canonical translation, also switch to that language. [maurits]

  • On the manage_translations page do not show the form for linking to other content or deleting/unlinking existing translations when the current context is not the canonical language. Instead add a url to that canonical language. [maurits]

  • When adding a translation, do not throw an error when the language does not exist, but display that as info and go to that existing translation. I saw the ‘add translation’ option still for an already translated language, due to some caching. [maurits]

  • Ignore back reference when it is None. [maurits]

  • Made sure that an existing FieldIndex Language gets correctly replaced by our wanted LanguageIndex, instead of leaving an unusable index with an empty indexable attribute. [maurits]

  • Check if plone.browserlayer is installed before starting a possibly long reindex that would then be aborted. [maurits]

  • Make tests run on Plone 3.0.6 with plone.browserlayer 1.0rc3 and original GenericSetup (1.3) next to simply Plone 3.1. [maurits]

2.1.1 - May 1, 2008

2.1 - April 11, 2008

  • Use our language selector viewlet for all content types instead of just translatable types. This makes things consistent for all types. [wichert]

  • Be more tolerant in unindexing non-existent content. [hannosch]

  • Allow languages to be unselected in the language control panel. [wichert]

  • Do not use LanguageDropdownChoiceWidget for the default language field in the control panel: LanguageDropdownChoiceWidget uses IUserPreferredLanguages, which does not use the proper vocabularies to find the language names. [wichert]

2.1beta1 - April 7, 2008

  • Register the LanguageIndex with the selection widget, so you can query for languages in Collections. [hannosch]

  • Enable the Plone language portlet and change its rendering link correctly to translations if they exist and to the site root otherwise. [wichert]

  • Dont depend on Quickinstaller at setup time and in browsermenu. [jensens]

  • Minor GenericSetup cleanup [jensens]

  • Make LinguaPlone play nice with archetypes.schemaextender and similar approaches. [jensens]

  • Declare plone.browserlayer as a dependency in our GenericSetup profile. This will automatically install it in Plone 3.1. [wichert]

  • Better unlink handling. This fixes http://plone.org/products/linguaplone/issues/127 [wichert]

2.1alpha1 - December 13, 2007

  • Refuse to install LinguaPlone of plone.browserlayer is not already installed. [wichert]

  • Register the PloneLanguageTool GenericSetup export/import steps in LinguaPlone as well. Standard Plone 3 installs never applied the PloneLanguageTool GenericSetup context, so without this portal_languages.xml would be ignored. [wichert]

  • Replace the standard Plone language control panel with our own version which allows enabling of multiple languages. [wichert]

  • Manage translations form now uses a kupu drawer when the kupu reference browser is enabled. [Duncan]

  • Actions from the manage translations screen now stay on that screen so multiple translations may be linked. Existing translations display their path. [Duncan]

2.0 - October 11, 2007

  • When creating new content in a translated parent use the language of the parent as the default language. [wichert]

  • Try to unlock objects before moving them into a newly translated folder. [wichert]

  • Add a test in the GS various import step if the Language catalog index in portal_catalog has indexed any objects. If not we just (re)created the index and we need to reindex it. This fixes content disappearing after installing LinguaPlone. [wichert]

  • Remove the code to mark LinguaPlone as installed in the quickinstaller from the GS profile: we can install LinguaPlone through the quickinstaller itself so this is not needed. [wichert]

2.0beta2 - September 24, 2007

  • Fix a syntax error in the translate_item template. [wichert]

  • Restructure the LinguaPlone product layout so it can be distributed as an egg. [wichert]

2.0beta1 - September 21, 2007

  • Allow translating the default view for an untranslated container again: we have correct code that adds a translation of the container as well now. [wichert]

  • Correct creationg of translations for objects which are the default view of a non-translatable parent. [wichert]

  • Correct handling of the translate into-menu for content with an untranslatable parent. [wichert]

2.0alpha2 - September 19, 2007

  • Only show the content menu if LinguaPlone is installed in the quick installer. [wichert]

  • Update functional tests to login as a member so the test can use unpublished content. [mj]

  • Disable the menu option to translate the default view for a folder to a language for which the folder has no translation. [wichert]

2.0alpha1 - September 10, 2007

  • Use a GenericSetup profile to install LinguaPlone. [wichert]

  • Move createTranslations to a @@translate browser view. [wichert]

  • Port to Plone 3.0.1. [wichert]

1.1 - UNRELEASED

  • Only allow linking to other objects of the same portal type. [wichert]

  • Add a sanity to prevent addTranslationReference from adding translations for languages which already have a translation. [wichert]

  • Policy change for language selector. We try to avoid disabled flags by looking for a translated parent. [fschulze]

  • Added UI to link translations together. [vlado, fschulze]

  • Changed to use _createObjectByType on addTranslation, bypassing possible conflicts with adding restrictions. [deo]

1.0.1 - September 24, 2007

  • Fix spitLanguage to return (None, None) when fed a non-string object. This fixes LP issue #101. [mj]

  • Fix LanguageIndex to deal better with objects where Language is either missing or not a callable. Fixes LP issue #99. [mj]

  • Fix LanguageIndex to run on python 2.3. [wichert]

  • Fix language selector to not go the the login screen if one of the translations is not accessible (i.e. in “private” state) [fschulze, godchap]

1.0 - June 19, 2007

  • If we are resetting the language due to a schema update do not delete the translation references. This fixes http://plone.org/products/linguaplone/issues/7 [wichert]

  • Removed Plone 2.0 compatibility. [fschulze]

  • Add a utility method to link content objects as translations. This is useful, for example, in a GenericSetup import step to link content created in a GenericSetup content step. [wichert]

  • Show the ‘Switch language to’ text in the language selector in the target language instead of the current language. [wichert]

  • Fixed so rename after creation only happend on TTW creation. Not on first edit of a through script created object. [sashav]

  • Fixed an issue if theres no getTranslations available. This happens if an non-lp-enabled at-based object exists direct in portal-object. [jensens]

  • Fixed some code that spit out DeprecationWarnings. [hannosch]

  • Instead of customizing switchLanguage we now have portlet_languages inside LinguaPlone and use the much nicer languageSelectorData. [jladage]

  • LanguageIndex is now a specialised index that will return alternative translations within the main language when searching. [mj]

0.9.0 - June 16, 2006

  • Now works with Plone 2.5 out-of-the-box, and Plone 2.1.3 if using the included PloneLanguageTool.

  • Fixed unicode error on translated languages in Plone 2.1.3. It can contains non-ascii characters, so the default strings need to be declared as unicode. [encolpe]

  • Fixed actions to fallback gracefully for the action attribute ‘name’ and ‘title’. [jladage] [encolpe]

  • Added the switchLanguage.py script and added support for translatable content. [jladage]

  • Fixed to lookup the language flag name directly from the language tool. Now, PloneLanguageTool 1.3 (or greater) is officially required. [deo]

  • Made tests compatible with Plone 2.5. [hannosch]

  • Some very minor i18n fixes. [hannosch]

  • Added a migration script to update language independent fields content. It must be manually run when upgrading from versions older than 0.9. [deo]

  • Removed the custom accessor/editAccessor generation. We’re only using custom mutators and translation mutators for now. This result in a ~30% performance improvement over the previous versions. [deo]

  • Made sure to copy independent language fields data to all translations as we removed the custom accessor. This also fixed the problem when you try to get values direct from fields, as now the data is in the translations too, not only in the canonical object. [deo]

  • Forwared fix for http://dev.plone.org/plone/ticket/4939. [deo]

  • Fixed a problem when switching between translations of images/files, where the content was shown, instead of the view screen. [deo]

  • Fixed to highlight the ‘Edit’ tab from a translation when you click it. [deo]

  • Final cut on Plone 2.0 compatibility. Backported tests, handled migrations and patched tool with the PythonScripts content. [deo] [sidnei]

  • Added labels to language-independent fields. [deo] [limi]

  • Made the initial default language follow the PloneLanguageTool config policy. [deo]

0.9-beta - October 27, 2005

  • Removed content border from Translation Unavailable template. [limi]

  • Made the test fields that are not editable render in view mode, not as non-editable text boxes. The reasons for this are that people tend to think that “if it is a text box, it’s editable”, and are then confused when it’s not (read-only widgets confuse the heck out of users), and the other reason is because it messes up multiple selection lists. [limi]

  • Made language-independent items not editable in a translation. [limi] [deo]

  • Added first cut on Plone 2.0 compatibility. [deo]

  • Fixed i18n domain everywhere… :-) [deo]

0.8.5 - September 6, 2005

  • Made content be created in neutral language, now that this concept works as expected. [deo]

  • Made addTranslation raise an AlreadyTranslated exception when trying to duplicate a translation. [deo]

  • Added form to create translation when the language don’t exist and if the user has the appropriate permissions. [deo]

  • Title on the flag switcher should say: “Switch language to $LANGUAGE (content translation not available)” - the last part if the content is not translated, to complement the ghosting (which is purely visual, and bad for accessibility). [deo]

  • Split screen should change sides (“From” language to the left, “To” language to the right). [deo]

  • Split screen should not show short name if turned off (like the default is in 2.1). [deo]

  • Flags aren’t on a separate line anymore (they used to be below the document actions). [limi]

  • Field titles are translated, field help is not. [deo]

  • Flags should probably be removed from the field titles, since the pulldown might make these misleading. [deo]

  • Split-screen pulldown needs language selectors when translating. [deo]

  • Use the translate_item template when editing translatable content, except the canonical one. [deo]

  • PloneLanguageTool has problems without LinguaPlone installed. [deo]

  • Added norwegian translation. [limi]

  • Improved i18n markup. Updated brazilian portuguese translation. [deo]

0.8 - August 15, 2005

  • Plone __browser_default__ review. [deo]

  • Adjust LP catalog patch for Plone 2.1. [stefan]

  • Allowed changing language of content, moving content to appropriate place, and raising a exception when forbidden. [deo]

  • Design the policy for the New language negotiator. [limi]

  • Grayed out flags. [deo, limi]

  • Handle switching to non-existing language (a.k.a. not_available_lang). [deo]

  • Handle translation of default pages. [deo]

  • Added hasTranslation() method for grayed-out flags. [deo]

  • ID policy for translating containing folder and moving translated content. [limi]

  • Language switching: the URL on flags should be the actual URL, not switchLanguage?set_language=no. [deo]

  • Fixed languageswitcher in Firefox. [deo]

  • LinguaPlone should not append language code to ID, it should use the same Plone 2.1 policy. [deo]

  • Implemented the new language negotiator, where content and interface languages are always in sync. [deo]

  • Test that Images in ATCT are keeping the image LangIndependent. [limi]

  • Update dropdown menus markup. [deo]

0.7 - September 24, 2004

  • Released at Plone Conference 2004. [limi] [testal] [geir]

Technology Preview - June 29, 2004

  • First publicly available version. [limi] [testal] [geir]

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Products.LinguaPlone-2.2.zip (149.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page