Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Internet > HTTP (WWW)

    django-model-i18n 0.4.2

    Download button

    No screenshots available
    Downloads: 70  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Gonzalo Saavedra, Matias Aguirre and Juan Pablo Martinez | More programs
    BSD License / FREE
    August 16th, 2012, 11:59 GMT
    ROOT / Internet / HTTP (WWW)

     Read user reviews (0)  Refer to a friend  Subscribe

    django-model-i18n description

    A Django application that tries to make multilingual data in models less painful

    django-model-i18n is a Django app that tries to make multilingual data in models less painful.

    Installation

    * cloning repository

    Configuration

    Go to urls.py into root project directory and put this

        from model_i18n import loaders

        loaders.autodiscover_admin()


    also add 'django.middleware.locale.LocaleMiddleware' into MIDDLEWARE_CLASSES::

        MIDDLEWARE_CLASSES = (
            'django.middleware.common.CommonMiddleware',
            'django.contrib.sessions.middleware.SessionMiddleware',
            ## IF CACHE MIDDLEWARE IS SETTING PUT HERE
            'django.middleware.locale.LocaleMiddleware',
            'django.middleware.csrf.CsrfViewMiddleware',
            'django.contrib.auth.middleware.AuthenticationMiddleware',
            'django.contrib.messages.middleware.MessageMiddleware',
            'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
        )

    and finally put in INSTALLED_APPS::

        INSTALLED_APPS = (
            'model_i18n',
            ...
            'django.contrib.admin',
            ...
        )


    **When putting model_i18n must be first in the list of INSTALLED_APPS.**

    Usage

    1) In the directory of the application create a translations.py
    2) Inside the file you need to register translations like this example::

        from model_i18n import translator
        from app.models import Item

        class ItemTranslation(translator.ModelTranslation):
            fields = ('title',)

        translator.register(Item, ItemTranslation)



    Product's homepage

    Here are some key features of "django-model-i18n":

    · Easy installation and integration. No data or schema migration pain.
    · Each multilingual model stores it's translations in a separate table, which from django is just a new model dynamically created, we call this model the translation model.
    · You can add (or even drop) i18n support for a model at any time and you won't need to migrate any data or affect the original model (we call this the master model) table definition. This allows you to develop your apps without thinking in the i18n part (you even can load data for the main language and you won't need to migrate it) and when you are comfortable with it register the multilingual options and start working with the content translations.
    · 3rd party apps friendly. You can add i18n support to the existing models without modifying their definition at all (think in apps you can't modify directly for example djago.contrib.flatpages).

    Requirements:

    · Python
    · Django

      


    TAGS:

    multilingual data | Django models | Django | models | i18n

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM