From c0b2cae0d350b6ad6e9f06182775dd8b189d9e0f Mon Sep 17 00:00:00 2001 From: Tom Dyson Date: Thu, 6 Aug 2015 17:35:05 +0100 Subject: [PATCH 1/2] README formatting and typo fixes --- README.rst | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/README.rst b/README.rst index 35d13b5..34e8a7d 100755 --- a/README.rst +++ b/README.rst @@ -4,17 +4,17 @@ Wagtail Modeltranslation This app is based on django-modeltranslation: https://github.com/deschler/django-modeltranslation -It's an alternative approach for inexistent support to i18n on Wagtail CMS websites. +It's an alternative approach for i18n support on Wagtail CMS websites. The modeltranslation application is used to translate dynamic content of existing Wagtail CMS 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 be able to add translations to existing or new -projects and is fully integrated into the Django admin backend. +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, -may they use translations or not, and you never have to touch the original +whether or not they use translations, and without touching the original model class. @@ -29,7 +29,7 @@ Features - 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 CMS admin integration +- Wagtail admin integration - Flexible fallbacks, auto-population and more! - Default Page model fields has translatable fields by default - StreamFields are now supported! @@ -38,29 +38,29 @@ Features Quick start ----------- -1. Install "wagtail-modeltranslation": +1. Install "wagtail-modeltranslation":: pip install wagtail-modeltranslation -2. Add "wagtail_modeltranslation" to your INSTALLED_APPS setting like this (before all apps that you pretend to translate):: +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: +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: +4. Enable i18n on settings.py:: USE_I18N = True -5. Define available languages on settings.py: +5. Define available languages on settings.py:: LANGUAGES = ( ('pt', u'Português'), @@ -68,25 +68,27 @@ Quick start ('fr', u'Francês'), ) -6. Create translation.py inside root folder of app where model you pretend to tranlslate exists: +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 TranslationMixin to translatable model: +7. Add TranslationMixin to translatable model:: + from wagtail_modeltranslation.models import TranslationMixin + class FooModel(TranslationMixin, Page): body = StreamField(...) -8. Run "./manage.py makemigrations" followed by "./manage.py migrate" +8. Run `./manage.py makemigrations` followed by `./manage.py migrate` @@ -96,4 +98,4 @@ https://github.com/infoportugal/wagtail-modeltranslation Documentation ------------- -soon available +Coming soon From 35022929e69c6e1dc0ed8d07c8b5601fe30b5f23 Mon Sep 17 00:00:00 2001 From: Tom Dyson Date: Thu, 6 Aug 2015 17:40:04 +0100 Subject: [PATCH 2/2] More README formatting tweaks --- README.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 34e8a7d..ffd6792 100755 --- a/README.rst +++ b/README.rst @@ -7,7 +7,7 @@ This app is based on django-modeltranslation: https://github.com/deschler/django It's an alternative approach for i18n support on Wagtail CMS websites. The modeltranslation application is used to translate dynamic content of -existing Wagtail CMS models to an arbitrary number of languages without having to +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. @@ -38,7 +38,7 @@ Features Quick start ----------- -1. Install "wagtail-modeltranslation":: +1. Install :code:`wagtail-modeltranslation`:: pip install wagtail-modeltranslation @@ -81,15 +81,14 @@ Quick start 'body', ) -7. Add TranslationMixin to translatable model:: +7. Add :code:`TranslationMixin` to your translatable model:: from wagtail_modeltranslation.models import TranslationMixin class FooModel(TranslationMixin, Page): body = StreamField(...) -8. Run `./manage.py makemigrations` followed by `./manage.py migrate` - +8. Run :code:`python manage.py makemigrations` followed by :code:`python manage.py migrate` Project Home