Django internationalization switching between languages

I have a french and a english site up, very basic. I created my fr language file. I have a few translated strings to test this to make sure it works but I am confused as how to set up the actual link to swap between languages. I have followed this, but receive a 404 for /next/page, am i doing this correctly? Here is my code if this helps:

                <form action="/i18n/setlang/" method="post">
                {% csrf_token %}
                <input name="next" type="hidden" value="/next/page/" />
                <select name="language">
                {% get_language_info_list for LANGUAGES as languages %}
                {% for lang in LANGUAGES %}
                    {% if lang.0 != '' %}
                        <option value="{{lang.0}}">{{lang.1}}</option>
                    {% endif %}
                {% endfor %}
                <input type="submit" value="Go" />

I have also added my urls like so:

(r'^i18n/', include('django.conf.urls.i18n')),

And I have this in my settings for middleware and language:


    ('en', 'English'),
    ('fr', 'French'),

I am confused as to how to have this working so i can swap between the 2 languages, or, If I am doing it correctly, why am I getting that 404 error with the /next/page when trying to change languages?




In this line

<input name="next" type="hidden" value="/next/page/" />

you have to substitute "/next/page/" with the page that you want to load after the language change.

In case that you want to load the same page, you should write value="".

Need Your Help

iPhone:Twitter integration

iphone twitter

I followed the below link to integrate Twitter into my application.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.