You are not logged in Log in Join
You are here: Home » Members » tmclaugh » InternationalObjects

Log in
Name

Password

 
 

Folder icon InternationalObjects

It makes multilingual development simple by MonkeyPatching the Item class.

Quick Start:

Make any attributes that are multilingual named according to the convention:

XX__ATTRIBUTE

where XX is the first two characters of the language code and ATTRIBUTE is the name of the attribute as it is accessed in programming.

Now you can access the attributes of the object in DTML or PythonScripts using just the attribute name and the appropriate attribute will be selected and returned. This works with PropertyManager too! Just add the attributes in the properties to a DTML Doc. Note that Title does not work because it is defined as being an empty string in the Item class.

To change the default language and the available languages modify the constants in the beginning of __init__.py. Good luck!

NOTE that this requires the get_request patch which ZC is not allowing into the code-base. I'm not sure why, and others agree with me (notably Stephen Richter), but currently you just have to patch it yourself. It's here.

 Title   Type   Size   Modified   Status 
 default Edit object Software Release   2001-10-11 published