Multilangual sites with Kotti
Project description
Multilingual Sites with Kotti.
Kotti’s data model includes a language attribute on the Content class, from which all content types inherit. However, this attribute is neither exposed by Kotti’s UI, nor used in any other way. kotti_multilingual provides a generic approach to build multilingual sites.
Work in Progress
kotti_multilingual is still in an early stage of development. It is neither feature complete nor can be considered API stable. Things will change!
Features
The package contains a single content type LanguageRoot which is supposed to be the container of all content in a specific language. All content that is created in (or moved into) such a subtree will be automatically tagged with the language of the root. This is done by subscribing to Kotti’s ObjectInsert and ObjectUpdate events.
You can place LanguageRoot instances wherever you want in your content tree, but it is considered best practice to have a tree structure like this:
- / Document language neutral - /en LanguageRoot English - /de LanguageRoot German - /nl LanguageRoot Dutch - /images Document language neutral
Setup
To activate the kotti_multilingual add-on in your Kotti site, you need to add an entry to the kotti.configurators setting in your Paste Deploy config. If you don’t have a kotti.configurators option, add one. The added entry should look like this:
kotti.configurators = kotti_multilingual.kotti_configure
You can register an optional kotti_multilingual.blacklist with the list of the type names not handled by kotti_multilingual.
Tests
The test setup requires additional steps:
$ virtualenv --no-site-packages . $ source bin/activate $ pip install -r requirements.txt $ python setup.py develop $ python setup.py dev
How to launch tests:
$ py.test
Changelog
0.2a3 (2015-04-27)
Fixed 0.2a2 version (still wrong MANIFEST.in)
0.2a2 (2015-04-27)
Fixed MANIFEST.in file
0.2a1 (2015-04-27)
Maintain translation links between content items, with translation source and targets.
Add a translation dropdown UI for adding a translation of an item.
Added widget.i10n_widget_factory deferred widget. Turns field into readonly mode if the context is a translation.
This deferred widget is also compatible with add forms, you should bind an addform property to True and the widget will be rendered as usual in edit mode. You can do that adding a get_bind_data method on your add form.
Added a kotti_multilingual.blacklist setting with a list of type names not translatable
Changed policy for translate action. Now the translated document is automatically filled with the parent translation (enhanced usability since we don’t have the screen splitted in two parts like LinguaPlone). This is possible thanks to a change in sqla.py since we don’t set language independent attributes on translated documents
Fixed translation of objects with not nullable fields
Added support for sqlalchemy’s association_proxy
Fixed intermittent problem with get_source (integrity error)
0.1a3 - 2013-05-08
Rename LanguageSection to LanguageRoot to better fit Kotti’s INavigationRoot. This implies a change in the DB schema for which no automatic schema migration is available; you’ll have to rename the table language_sections to language_roots yourself.
Add some tests.
0.1a2 - 2013-05-07
Removed a lot of code that’s now replaced by Kotti’s INavigationRoot / TemplateAPI.navigation_root. This greatly simplifies the setup of kotti_multilingua.
Depend on Kotti>=0.9a3dev (needed for the above).
0.1a1 - 2013-05-06
Initial release.
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
File details
Details for the file kotti_multilingual-0.2a3.tar.gz
.
File metadata
- Download URL: kotti_multilingual-0.2a3.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5731bcf33569b81c6f2aa0381dbb7a53455272cecf856b9d7b0a70cc07d73162 |
|
MD5 | 1c29e6d7339f63769d1e3d2047091794 |
|
BLAKE2b-256 | 1278adbb724977a3eed84d894511ca1ba8da202d13cb25900bbbb33a41f6d7cd |