Git Product home page Git Product logo

yawd-translations's Introduction

yawd-translations, create multilingual django websites

yawd-translations provides a set of tools for creating multilingual websites with django.

The application includes the following tools:

  • Manage the website's installed Languages through the admin interface

  • Generate translation messages (makemessages and compilemessages) for all installed applications and defined languages using the admin interface (no need to restart the web server).

  • Translatable db models API

  • A custom admin inline to manage db translations

  • A custom middleware to replace django.middleware.locale.LocaleMiddleware and achieve the following:

    • Change the way django detects language preference and use the db default language (set through the admin interface)
    • Redirects to language-dependant URLs are permanent (301) and not temporary (302).
  • A patterns function (that behaves pretty-much like django's own i18n_patterns() does) to achieve the following:

    • Match root URL paths as default language URLs: If your default language is English (en), i18n_patterns() will not match the / URL as the english homepage and the django middleware would redirect pages to their /en/ equivalent (e.g. your homepage would be http://example.com/en/ and all requests to http://example.com/ would be redirected to http://example.com/en/). The custom patterns function implements the exact opposite, which is a common practice to web development. Therefore http://example.com/ will be matched as the real permalink (instead of http://example.com/en/). For non-default languages, the custom patterns function behaves like i18n_patters() does.
  • A context processor to access available languages in your templates and a simple template tag to easily switch between the available translations of a page in the front-end website.

Note

yawd-translations v0.5.2 is the last version intended to work with Django 1.4. The current master is actively developed under Django 1.5 and does NOT work with older Django releases. For those still using Django 1.4, you can checkout the 0.5.x branch or use the yawd-translations v0.5.2 pypi package. New features will not be backported to the 0.5.x branch. Since many of us run production systems tied to Django 1.4, both v0.5.2 and the latest documentation will be online on readthedocs.org.

Usage and demo

See the yawd-translations documentation for information on how to install the demo and use yawd-translations.

Bitdeli badge

yawd-translations's People

Contributors

bitdeli-chef avatar gstrat avatar xaroth avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.