i18n 
====

MultilingualURLMiddleware
-------------------------

The multilingual URL middleware adds a language prefix to every URL. 

Example:

	/de/account/login/
	/fr/account/login/

It also adds this prefix automatically to every href and form tag.


Language Chooser
----------------

The language_chooser template tag will display a language chooser for the current page.
You can modify the template in cms/language_chooser.html or provide your own template if necessary.

Example:

	{% load cms_tags %}
	{% language_chooser "myapp/language_chooser.html" %}

If the current URL is not handled by the CMS and you have some i18n slugs in the URL you may use
the set\_language\_changer function in the view that handles the current URL:

In the models of the current object add an optional language parameter to the 'get_absolute_url' function:

	def get_absolute_url(self, language=None):
		reverse("product_view", args=[self.get_slug(language=language)])


In the view pass the get\_absolute\_url function to the set\_language\_chooser function:

	from cms.utils import set_language_changer
	
	def get_product(request, slug):
		item = get_object_or_404(Product, slug=slug, published=True)
		set_language_changer(request, item.get_absolute_url)
		...
	
This allows the language chooser to have another URL then the current one.
If the current URL is not handled by the CMS and no set\_language\_changer function is provided it will take the exact
same URL as the current one and only will change the language prefix.

For the language chooser to work the MultilingualURLMiddleware must be installed.

page\_language\_url
-----------------

This template_tag returns the URL of the current page in another language.

Example:

	{% page_language_url "de" %}
