Skip to main content

Providing multi language fields and widgets

Project description

Introduction

raptus.multilanguagefields provides Archetypes fields and catalog indexes which are able to store multiple languages.

Migrating

Migration of already populated plone sites which where previously not running raptus.multilanguagefields is done by using the script migrate.py in the scripts folder of this package.

migrate -- migrate an existing single language site to a multilingual
           site using raptus.multilanguagefields

Usage: bin/instance run path_to_this_script path_to_the_desired_plone_instance_in_zope [path_to_the_desired_plone_instance_in_zope] ..

Options:
-h/--help -- print usage message and exit

The script will iterate over all objects in your plone instance and replace the value of the default language, if non is available, by the one set before using raptus.multilanguagefields.

Example

Say you have a plone instance with the ID “Plone” in your zope root folder which has it’s content already populated in english and you need another language, say german, which you would like to provide using raptus.multilanguagefields and the additional package raptus.multilanguageplone.

Now if you just install raptus.multilanguageplone your already populated english content will no longer be visible and that is when you have to run this script.

Shut down your zope and make sure you have a backup of your database and your third-party storages like blob or sql.

Now run the script as followed:

bin/instance run [path_to_this_script] Plone

This will copy the already populated english content into the default language set in the portal_languages tool, which in your case should be english. Now start up your zope and your plone content should be back in place.

Changelog

1.1b6 (2013-08-21)

  • Plone 4.3 compatibility.

1.1b5 (2013-07-22)

  • Set correct http response headers for diazo to be happy. Besides, do not unparse already parsed json data. [kiorky]

1.1b4 (2013-04-15)

  • Be way more defensive when setting and resetting languages on fields (Added try/finally clauses accordingly) [skaeser]

1.1b3 (2013-03-21)

  • Fixed bug in redirection

1.1b2 (2013-03-18)

  • Fixed wrong call to index_html into blobfields [jnachtigall]

1.1b1 (2013-02-06)

  • German translations

1.1a7 (2012-09-26)

  • Fixed ‘UNAUTHORIZED’ error generated by mymemory.translated.net

  • Allow widget_macro from a higher order

1.1a6 (2012-05-31)

  • Python 2.4 & Plone 3 compatibility

  • Fixed import in migrate.py

1.1a5 (2012-04-17)

  • Restored translation functionality by using the free web service of http://mymemory.translated.net

  • Added helper javascript file (multilanguage_tiny_mce_init.js) setting the text format to text/html and hiding it for multilanguage TinyMCE fields

1.1a4 (2012-03-21)

  • Fixed post validation of ATCTFileContent to prevent unhandled CopyError when adding a file to a folder where an object with the same ID already exists

1.1a3 (2012-02-13)

  • Added missing fallback check in image traversers

1.1a2 (2012-02-13)

  • Fixed fallback issue for non blob file and image fields

1.1a1 (2012-02-06)

  • Fixed redirection in images __bobo_traverse__

1.0 (2012-01-23)

  • Use Plone 4+ translation files system. (Translations now work under Plone 4) [thomasdesvenain]

  • Plone 4.1 compatibility. [thomasdesvenain]

1.0b17 (2011-09-28)

  • Final fix for the TinyMCE issue

1.0b16 (2011-09-26)

  • Fixed multilanguage blob fields (renaming now works, and several issues are resolved when using content language fallback)

  • Fixed image and file caching patch to support language fallback

  • Fixed TinyMCE issue where the wysiwyg editor was not displayed if no content was previously stored

  • Adjusted image scale traversal patches to make caching language aware

1.0b15 (2011-09-09)

  • Added patches to make caching of images and files language aware

1.0b14 (2011-05-09)

  • fixed validation_helper.js (removed misplaced ‘,’ which raised a javascript error in IE)

1.0b13 (2011-03-16)

  • fixed translator.js (selection of translatable content)

1.0b12 (2011-03-08)

  • fixed issue when translating text containing double quotes

  • added support for CKEditor (collective.ckeditor)

  • fixed tab selection issue after successful translation

1.0b11 (2011-02-10)

  • fixed kss validation without language fallback

1.0b10 (2010-12-08)

  • fixed CatalogBrain patch (now works for values other than strings, e.g. Subject)

1.0b9 (2010-12-07)

  • fixed traverse patches for ATImage and ATBlob which lead to a recursion when subclassing one of those types

1.0b8 (2010-11-30)

  • moved scripts folder into the package to make it available in the egg

1.0b7 (2010-11-03)

  • created migration script to migrate content of a previously monolingual site into the default language of the appropriate multilanguage fields

  • added possibility to get the original language of a field by passing lang=’original’

  • fixed AttributeError in getTranslator method

1.0b6 (2010-11-02)

  • added patches for plone.app.imaging and plone.app.blob

  • fixed multilanguage blob file and image fields

  • added patches for image and file content types (previously located in raptus.multilanguageplone)

  • fixed required attribute handling if language fallback is enabled

  • removed versatile caching of supported languages in indexes to prevent invalidity when changing the supported languages and not restarting zope

1.0b5 (2010-10-28)

  • UI improvements
    • Added custom validation error if default language is missing in a required field

    • Default language always comes first and is marked

  • Removed .mo files from i18n folder

  • Fixed CSS bug in language tabs for plone 4

1.0b4 (2010-10-18)

  • fixed catalog patch. After load the data with json we get a encoding problem. Noticeable by adding new portlet with non-ascii chars.

1.0b3 (2010-08-20)

  • fixed catalog patch. The catalog can’t store proxy-class, so we need to parse the multi value to a string. This problem was only on plone4.0

  • fixed error by creating new contenttypes. this error was provided by the get method of ImageFields.

1.0b2 (2010-08-07)

  • fixed validation process to work with file and image fields

1.0b1 (2010-07-30)

  • added custom kssFieldValidation to work with multilanguage fields

  • fixed field validation to respect content fallback and work with validators

0.9 (2010-05-20)

  • added catalog.xml to test profile to add multilanguage indexes

  • implemented default language fallback #5

0.8 (2010-02-23)

  • reverted change @110991

  • new doctests added without errors :

    • multilanguage text field ‘title’ added in SampleType

    • copy of schemas with multilanguage fields inside

  • new doctests added with errors :

    • standard plone rename forms do not work

    • object serialization with multilanguage fields inside do not work (ExtensionClass error)

  • fix the two previous errors :

    • the set method in MultiLanguageFieldMixin set the value for the current language when value is not a dict (fix rename forms)

    • the MultiLanguageFieldMixin class must inherit from ExtensionClass.Base

    • the MultiLanguageWidgetMixin class must inherit from ExtensionClass.Base

0.7 (2010-02-16)

  • cleaned up and added patches necessary when using primary fields with archetypes schemaextender (patches/archetypes.py)

  • removed unused variable (widgets.py)

  • Added license information

  • added “Uninstall” in uninstall profile registration for a better GenericSetup visibility in ZMI

  • added minimal framework for tests

  • added a minimal doctest (that was broken)

  • fix zope2 initialization (minor refactoring) to make doctests working

  • Added 2 Archetypes Schemata patches to avoid errors when reordering fields with an external schema extender (IOrderableSchemaExtender) applied to the schema with multilingual fields inside.

  • Added validation_required, a simple validation for required multilingual fields.

  • Some refactoring to make code more clear :

    • put monkey patches in patches folder

    • put different patches in different files

    • added Log whith patches

    • put MultiLanguageAware in a separate file (proxy.py)

  • Added samples types and specific profile for tests

  • Added doctests on multilingual fields and catalog search

  • fix http://plone.org/products/raptus.multilanguagefields/issues/2 translate a rich widget without kupu

  • The MultilanguageFieldMixin must inherit from Products.Archetypes.Field.ObjectField and MultilanguageWidgetMixin from Products.Archetypes.Widget.TypesWidget The Super Class of fields/widgets must be a field/widget to avoid problems with some low level methods.

0.6 - (2010-01-29)

  • changed criterion indices registration to avoid warning messages on startup

0.5 - (2010-01-28)

  • bugfix in multilanguage ZCTextIndex where index setter set the same value for indexes of all languages

0.4 - (2010-01-28)

  • added support for multilanguage image fields

0.3 - (2010-01-26)

  • added default atct indices to new criterion registrations as the old ones are overwritten

  • added multilanguageindexes to atct criterion registry

  • fixed UnicodeEncodeError in CatalogBrain monkey patch

0.2 - (2009-12-02)

  • Added README.txt

  • Metadata of catalog brains now contains value of current language rather than a MultilanguageAware object (fixes issues when converting to unicode)

  • Added attribute access

0.1 - (2009-10-30)

  • Initial release

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

raptus.multilanguagefields-1.1b6.zip (114.3 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