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:
<code>
<form action="/i18n/setlang/" method="post">
<input name="next" type="hidden" value="/next/page/" />
<select name="language">
{% for lang in LANGUAGES %}
<option value="{{ lang.0 }}">{{ lang.1 }}</option>
{% endfor %}
</select>
<input type="submit" value="Go" />
</form>
</code>
This of course means the user has to click on the language required,
then click the submit button. The result is put in POST data, and then
the redirect to " /i18n/setlang/" does its magic, then returns you
back to the page you came from, with the new LANGUAGE_CODE set up
correctly and, (here's the magic), the code is also automatically
stored in the user's session and cookie data, providing useful
persistence.
However, instead of clicking on submit, I would prefer the user to
click on just a regular link, so I nead to write something like..
<code>
<a href="/i18n/setlang?lang=fr&name=next>Click here for French</a>
</code>
which means it will use GET data.
The documentation says that redirect to set_language uses POST data,
so I guess my question could be rephrased as: How do I use a simple
link to send POST data to the page I am linking to? And I guess that
maybe this is not a Django-related question at all!
Still, maybe one of you kind people can help me or at least point me
in the right direction.
Thanks, Simon.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---