i18n Changes from the CPSCore

Revision: $Id$

Contents

This document provides some explanation about changes to handle i18n from a CPSCore 3.18.0.

1   ProxyBase:

New methods:

Intermediate Objects:

LanguageViewer:
This is called by the traversall on url like pathToObject/viewLanguage/fr. This will force getBestRevision to choose the requested language only during the request life. It is mainly used for indexing purpose.
LanguageSwitcher:
This is called by the traversall on url like pathToObject/switchLanguage/fr. This will force getBestRevision to choose the requested language. This choice is stored into session, so any further request to pathToObject will return the latest switchLanguage requested. It is used by the document language selector.

1.1   ProxyTool

getBestRevision(proxy, lang=None):
This method is called by any proxy.getContent() or getEditableContent It chooses which document revision/local to return in order. It tries to: (1) return the request lang locale if any, (2) return the locale set into the request by languageViewer, (3) return the locale set into session by languageSwitcher, (4) return Localizer selected locale, (5) return portal default locale, (6) return the first available locale.

1.2   PatchCatalogTool

IndexableObjectWrapper:
This class is redefined; this makes things easier. There is an optional parameter is_default_proxy; this enables for example creation of some index only for the default locale proxy. This will be useful when replacing portal_tree by catalog_navigation.
catalog_object():
If the object has only one locale, it behaves exactly like a standard CMF catalog. If the object has more than one locale (proxy.Languages()>1), then we create one entry by language with a path like: objectPath/viewLanguage/fr or objectPath/viewLanguage/en
uncatalog_object
If the object has more than one locale, it takes care of deleting all catalog entries (objectPath/viewLanguage/*). Otherwise works like CMF.

[ more info CPSDefault/doc/i18n-changes-from-CPSDefault-3_29_0.txt]