Django

Code

Changeset 751

Show
Ignore:
Timestamp:
09/30/05 15:13:41 (3 years ago)
Author:
hugo
Message:

i18n: added a note on request.LANGUAGE_CODE to the i18n documentation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/i18n/docs/translation.txt

    r750 r751  
    137137value. The language with the highest preference that is in the django base 
    138138message file directory will be used as the language to present to the user. 
     139 
     140Since the middlware discovers the language based on the request, your app 
     141might need to know what language is selected (if only to show the flag of 
     142that language). The selected language is stored by the middleware in the 
     143request as the LANGUAGE_CODE attribute. So with static translation (when 
     144you don't use the middlware) the language is in settings.LANGUAGE_CODE, while 
     145with dynamic translations (when you do use the middleware) it's in 
     146request.LANGUAGE_CODE. 
    139147 
    140148Creating Language Files