From 3049adf4859319a19e6a0f72eb172a13b71aaf06 Mon Sep 17 00:00:00 2001 From: Georg Bauer Date: Fri, 30 Sep 2005 20:13:41 +0000 Subject: [PATCH] i18n: added a note on request.LANGUAGE_CODE to the i18n documentation git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@751 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/translation.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/translation.txt b/docs/translation.txt index 6d655d9829..95272ae35d 100644 --- a/docs/translation.txt +++ b/docs/translation.txt @@ -137,6 +137,14 @@ So the middleware will iterate over that header, ordered by the preference value. The language with the highest preference that is in the django base message file directory will be used as the language to present to the user. +Since the middlware discovers the language based on the request, your app +might need to know what language is selected (if only to show the flag of +that language). The selected language is stored by the middleware in the +request as the LANGUAGE_CODE attribute. So with static translation (when +you don't use the middlware) the language is in settings.LANGUAGE_CODE, while +with dynamic translations (when you do use the middleware) it's in +request.LANGUAGE_CODE. + Creating Language Files =======================