Simple app containing a mixin model that integrates modeltranslation (https://github.com/deschler/django-modeltranslation) into wagtail panels system.
Find a file
2015-09-29 10:11:18 +01:00
docs Improved Index file 2015-08-20 23:57:30 -04:00
wagtail_modeltranslation merge grillr-workaround_inlinepanel to fix #31 2015-09-29 10:11:18 +01:00
.gitignore Code revision for #19 pull request 2015-08-12 14:25:32 +01:00
AUTHORS.rst fixed link for Contributers 2015-08-20 19:51:48 -04:00
CHANGELOG.txt Release v0.2.2: Added duplicate content buttons to translated StreamFieldPanels; 2015-08-12 15:20:54 +01:00
LICENSE.txt New version v0.2: 2015-08-04 17:42:43 +01:00
MANIFEST.in removed .pyc and .DS_Store files from pypi dist package 2015-08-10 15:26:16 +01:00
PKG-INFO Release v0.2.2: Added duplicate content buttons to translated StreamFieldPanels; 2015-08-12 15:20:54 +01:00
README.rst Added link to readthedocs 2015-08-21 00:01:14 -04:00
screenshot.png Added screenshot 2015-05-20 16:45:02 +01:00
setup.py Release v0.2.2: Added duplicate content buttons to translated StreamFieldPanels; 2015-08-12 15:20:54 +01:00

================
Wagtail Modeltranslation
================

This app is based on django-modeltranslation: https://github.com/deschler/django-modeltranslation

It's an alternative approach for i18n support on Wagtail CMS websites.

The modeltranslation application is used to translate dynamic content of
existing Wagtail models to an arbitrary number of languages, without having to
change the original model classes. It uses a registration approach (comparable
to Django's admin app) to add translations to existing or new projects and is 
fully integrated into the Wagtail admin UI.

The advantage of a registration approach is the ability to add translations to
models on a per-app basis. You can use the same app in different projects,
whether or not they use translations, and without touching the original
model class.


.. image:: https://github.com/infoportugal/wagtail-modeltranslation/blob/master/screenshot.png?raw=true
    :target: https://github.com/infoportugal/wagtail-modeltranslation/blob/master/screenshot.png?raw=true


Features
========

- Add translations without changing existing models or views
- Translation fields are stored in the same table (no expensive joins)
- Supports inherited models (abstract and multi-table inheritance)
- Handle more than just text fields
- Wagtail admin integration
- Flexible fallbacks, auto-population and more!
- Default Page model fields has translatable fields by default
- StreamFields are now supported!


Quick start
-----------

1. Install :code:`wagtail-modeltranslation`::

    pip install wagtail-modeltranslation

2. Add "wagtail_modeltranslation" to your INSTALLED_APPS setting like this (before all apps that you want to translate)::

    INSTALLED_APPS = (
        ...
        'wagtail_modeltranslation',
    )

3. Add "django.middleware.locale.LocaleMiddleware" to MIDDLEWARE_CLASSES on your settings.py::

    MIDDLEWARE_CLASSES = (
        ...
        'django.middleware.locale.LocaleMiddleware',
    )

4. Enable i18n on settings.py::

    USE_I18N = True

5. Define available languages on settings.py::

    LANGUAGES = (
        ('pt', u'Português'),
        ('es', u'Espanhol'),
        ('fr', u'Francês'),
    )

6. Create translation.py inside the root folder of the app where the model you want to translate exists::

    from .models import Foo
    from wagtail_modeltranslation.translator import TranslationOptions
    from wagtail_modeltranslation.decorators import register
    
    
    @register(Foo)
    class FooTR(TranslationOptions):
        fields = (
            'body',
        )

7. Add :code:`TranslationMixin` to your translatable model::

    from wagtail_modeltranslation.models import TranslationMixin
    
    class FooModel(TranslationMixin, Page):
        body = StreamField(...)

8. Run :code:`python manage.py makemigrations` followed by :code:`python manage.py migrate`


Project Home
------------
https://github.com/infoportugal/wagtail-modeltranslation

Documentation
-------------
http://wagtail-modeltranslation-docs.readthedocs.org/en/latest/#