Ticket #5489: i18n.diff
File i18n.diff, 1.3 KB (added by , 17 years ago) |
---|
-
docs/i18n.txt
641 641 642 642 (Note that this example makes the view available at ``/i18n/setlang/``.) 643 643 644 The view expects to be called via the `` GET`` method, with a ``language``645 parameter set in the query string. If session support is enabled, the view644 The view expects to be called via the ``POST`` method, with a ``language`` 645 parameter set in request. If session support is enabled, the view 646 646 saves the language choice in the user's session. Otherwise, it saves the 647 647 language choice in a ``django_language`` cookie. 648 648 649 649 After setting the language choice, Django redirects the user, following this 650 650 algorithm: 651 651 652 * Django looks for a ``next`` parameter in the query string.652 * Django looks for a ``next`` parameter in ``POST`` request. 653 653 * If that doesn't exist, or is empty, Django tries the URL in the 654 654 ``Referer`` header. 655 655 * If that's empty -- say, if a user's browser suppresses that header -- … … 657 657 658 658 Here's example HTML template code:: 659 659 660 <form action="/i18n/setlang/" method=" get">660 <form action="/i18n/setlang/" method="post"> 661 661 <input name="next" type="hidden" value="/next/page/" /> 662 662 <select name="language"> 663 663 {% for lang in LANGUAGES %}