Skip to main content

A set of tools that simplify handling multilingual content in Plone based on LinguaPlone

Project description

Project Description

Plone 4 is supported starting with version 1.4.0 - Bugfix releases for Plone 3 will be continued in the 1.3.x series.

Overview

slc.linguatools offers a set of functions that are designed to make life easier when dealing with multilingual sites, especially those with several different languages.

Often you have the requirement that you want to do the same action for all translations of an object. In a site with ten, twenty or more languages, doing this manually is not an option any more.

Functions

slc.linguatools offers assistance for the following use cases:

  • Set title or description:

    Set the title / description on all translations; either directly to the string you entered, or based on an i18n label and domain

  • Rename an object

    Rename all translations to the id (short name) you entered

  • Set portlets

    Propagate the portlet settings of the canonical object to all translations, either for all slots or the one you chose. Block / unblock portlet inheritance per slot.

  • Workflow

    Publish / retract / etc. all translations

  • Catalog reindex

    Reindex all translations of an object

  • Deleter

    Delete all translations of an object

  • Cut and paste

    Cut all translations of an object and paste them to another folder

  • Property handling

    Set a property with id, type and value on all translations. Example: Set string property “layout” to “@@my-shiny-view”. Delete an existing property.

  • Marker interfaces

    Set or remove a marker interface on all translations of an object. The interfaces available for setting and removing are provided by a vocabulary and are the same as on the “Interfaces” tab in the ZMI.

  • Subtyping (if p4a.subtyper is installed)

    Set a subtype on all translations; remove a subtype

  • Translate an object

    Create a translation of the current object for all available languages. The AT attributes that should be copied over can be selected. If the object is a Collection, then all criteria are copied as well.

  • Copy the values of individual fields

    Using the “Translate this object” function mentioned above and selecting the “Translation exists” option, you can copy the values of individual AT fields to all translations, such as dates, tags (Subject) and Collection criteria.

Requirements and Installation

This package only works and makes sense if you have LinguaPlone installed.

Add “slc.linguatools” to the eggs and zcml sections of your buildout configuration. After running buildout and restarting your instance, go to the Site Setup -> Add-on Products, choose slc.linguatools and click “install”.

A tab named “Lingua Tools” will then appear on all translatable objects.

Enabling support for language neutral folders in TinyMCE

If you have the default language folder structure (e.g. created by LinguaPlone’s @@language-setup-folders), you will have a top-level folder that provides INavigationRoot for every language in your site (/en, /de, /fr, etc.). In this case it will not be possible to have a common language-neutral folder (e.g. for images) that is accessible in TinyMCE. For details see: http://plone.org/products/linguaplone/issues/275

In this same ticket, a patch to the getBreadcrumbs method of TinyMCE was provided by Robert Niederreiter. This patch is included in slc.linguatools, but not activated by default. To activate it, you need to set an environment variable called PATCH_TINYMCE_BREADCRUMBS.

You can do this by adding the following to your zope.conf:

<environment>
PATCH_TINYMCE_BREADCRUMBS true
</environment>

If you use Buildout, you don’t want to edit zope.conf directly, since it will be overwritten by the next buildout. Rather, edit your buildout configuration and add the following to the [instance] section:

zope-conf-additional =
  <environment>
    PATCH_TINYMCE_BREADCRUMBS true
  </environment>

Versions

The first version of this tool featured a manually written BrowserView. During the Plone-Conference 2009 sprint, a second version that uses z3c form was written. This is the version visible by default via the “Lingua Tools” tab. The original version is still accessible under @@linguatools-old.

Documentation

Please also see test/lttest.txt for a doctest that guides you through the basic functionalities.

Change history

slc.linguatools Changelog

1.4.4 (2013-12-06)

  • Added a commit after every clone

1.4.3 (2013-04-10)

  • Cleanup, don’t require a REQUEST obj in exec_for_all_langs [pysailor]

1.4.2 (2012-07-22)

  • Switched to using plone.app.testing instead of zope.testing [thomasw]

  • Copied support for slc.outdated from the Plone3-branch [thomasw]

  • Moved repository from svn to github [thomasw]

1.4.1 (2012-02-04)

  • If an item has a text_format property (e.g. documents), copy its value to all translations in the “Translate this obejct” function [thomasw]

  • Added Robert Niederreiter’s patch to the getBreadcrumbs() method of TinyMCE to allow for common language-neutral folders (e.g. for images). See LP issue 275 for details. The patch needs to be activated by an environment setting. See the README.txt [thomasw]

1.4.0 (2011-07-01)

  • Removed version pinnings for dependencies [thomasw]

  • Slight CSS adjustments for main view [thomasw]

  • Added missing import of CMF permissions package [thomasw]

1.4.0b1 (2011-04-08)

  • Updated the doctest setup to run in Plone4 [thomasw]

  • Added possibility to make displaying a form optional, e.g. only if a certain component is installed [thomasw]

1.3.6 (2010-07-18)

  • Bugfix in PropertyForm: encode unicode to utf-8, otherwise setting the property default_page breaks [thomasw]

  • allow module utils for import in python scripts [pilz]

1.3.5 (2010-03-31)

  • In plone.z3cform version 0.5.8 a major change was introduced that affects our product. By overwriting update() and contents() of FormWrapper, we enable support for versions >=0.5.8; with an ugly hack in contents(), we maintain support for versions <=0.5.7 [thomasw]

  • Fixed broken doctest for changing the workflow, introduced in 1.3.3 [thomasw]

  • The AvailableIdsVocabulary now only returns translatable items [thomasw]

  • New functionality: Add and remove marker interfaces [thomasw]

  • Don’t show the canonical lang in the vocabulary of avaiable langs [thomasw]

1.3.4 (2010-02-09)

  • In the AvailableWorkflowTransitions vocabulary, return all available transitions of a workflow, not just those available for the canonical’s state. The canonical might be published, while some translations are still private [thomasw]

1.3.3 (2010-01-27)

  • Reworked workflow handling. Instead of only “publish”, now all transactions available on the current object can be triggered [thomasw]

  • “Translate this” now has an additional language field, so that only a subset of the available languages may be chosen [thomasw]

  • Ran the pep8 script and fixed most issues [thomasw]

1.3.2 (2009-12-17)

  • Bugfix in linguatools.css: missing closing bracket. Thanks for the heads-up, do3cc! [thomasw]

1.3.1 (2009-12-11)

  • Be more relaxed with version pinning needed for plone.app.z3cform [thomasw]

1.3 (2009-11-29)

  • Major revamp at Plone Conference 2009 sprint: moved from static BrowserView to z3c form; brushed up test coverage; clearer interface; more user-friendly, less typing necessary; easier to plug in new functionality [cillian, jcbrand, pilz, thomasw, Andreas Schmid]

1.2.5 (unreleased)

  • make sure that lang is ascii when using it to create objectids. Otherwise we get an infinite recursion [pilz]

  • D’oh another bug in “block portlets”, this time in the status message [thomasw]

  • better status reporting for translateThis; collection criteria are now also copied when “translation exists” is ticked; more graceful handling for unknown fields [thomasw]

1.2.4 (2009-10-27)

  • Continuing my fix for ambiguous variable name [thomasw]

1.2.3 (2009-10-25)

  • 2 bugs fixed for “block portlets”: ambiguous variable name, wrong button name [thomasw]

1.2.2 (2009-10-08)

  • 2 bugfixes in cutAndPaste (don’t despair if object is not available) [thomasw]

  • Added a contenview tab for Lingua Tools on ITranslatable objects [jcbrand]

  • In lingatools.pt moved the legends into the fieldsets, added labels and reorganised a bit [jcbrand]

  • Added new option to remove subtypes [jcbrand]

  • Use the default plone status messages for messaging and added event.log logging [jcbrand]

slc.linguatools 1.2.1 (2009-08-13)

  • made compatible with current version of LinguaPlone [gerken/thomasw]

slc.linguatools 1.2 (2009-06-17)

  • built a proper framework for the already existing doctest linguatests.txt [thomasw]

slc.linguatools 1.1 (2009-05-12)

  • Packaged egg [pilz]

slc.linguatools 1.0 (2008-03-31)

  • Initial port

Credits

Authors

  • Wolfgang Thomas (Syslab.com GmbH)

  • Alexander Pilz (Syslab.com GmbH)

  • Jan-Carel Brand (Syslab.com GmbH)

  • Cillian de Roiste (Syslab.com GmbH)

Contributors

  • Andreas Schmid (TIS Innovation Park): jquery toggle

  • Robert Niederreiter: patch for TinyMCE’s getBreadcrumbs

TODO

  • Find and use an object-picker widget for “Cut & Paste” - having to type the destination path is ugly.

  • Distinguish between global functions (e.g. Set title) and those that only make sense on a folder (e.g. Delete).

  • Add a configuration page in the control panel so that the manager can select the available functions (e.g. exclude the Marker Interface function)

Project details


Download files

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

Source Distribution

slc.linguatools-1.4.4.zip (70.1 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