Simon Tite wrote:
> The documentation on how the user can change the language of a page/
> site (from: http://www.djangoproject.com/documentation/i18n/), in the
> section  "The set_language redirect view", gives the following code:
>   

instead of the ponderous ruminations of the the venerous 
[EMAIL PROTECTED], here's a trivial
solution

<div id="languages">
          <table >
            <tr>
              {% for lang in LANGUAGES %}
              <td>
            {% comment %}
            <b>Kind of weird', depending on version, Django wants either 
a GET or a POST to set the cookie</b>
            {% endcomment %}
           
            <form action="/http_frontend/i18n/setlang/" method="post">
              <input type="hidden" name="language" value="{{lang.0}}"/>
              <input id="lang_{{lang.0}}" type = "image" 
src="/media/http_frontend/img/{{ lang.0 }}.gif" alt="{{ lang.1 }}"/>
            </form>
              </td>
              {% endfor %}
            </tr>
          </table>     
        </div>

just pass in LANGUAGES from the settings and provide images

And yes, I was baffled to realize that somehow between early 0.96 and 
svn versions it seems to have flipped from
GET to POST. POST is more logical of course

    -- tony

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to