Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Made description of LANGUAGE_CODE setting more clear.

  • Loading branch information...
commit 297f5af222bde02a7cdd005da2e4b00ec81801de 1 parent 8cd8742
Ramiro Morales authored August 22, 2013
15  docs/ref/settings.txt
@@ -1290,11 +1290,22 @@ LANGUAGE_CODE
1290 1290
 
1291 1291
 Default: ``'en-us'``
1292 1292
 
1293  
-A string representing the language code for this installation. This should be
1294  
-in standard :term:`language format<language code>`. For example, U.S. English
  1293
+A string representing the language code for this installation. This should be in
  1294
+standard :term:`language ID format <language code>`. For example, U.S.  English
1295 1295
 is ``"en-us"``. See also the `list of language identifiers`_ and
1296 1296
 :doc:`/topics/i18n/index`.
1297 1297
 
  1298
+:setting:`USE_I18N` must be active to this setting to have any effect.
  1299
+
  1300
+it serves two purposes:
  1301
+
  1302
+* If the locale middleware isn't in use, it decides which translation is served
  1303
+  to all users.
  1304
+* If the locale middleware is active, it provides the fallback translation when
  1305
+  no translation exist for a given literal to the user preferred language.
  1306
+
  1307
+See :ref:`how-django-discovers-language-preference` for more details.
  1308
+
1298 1309
 .. _list of language identifiers: http://www.i18nguy.com/unicode/language-identifiers.html
1299 1310
 
1300 1311
 .. setting:: LANGUAGE_COOKIE_NAME
13  docs/topics/i18n/translation.txt
@@ -1550,14 +1550,17 @@ should be used -- installation-wide, for a particular user, or both.
1550 1550
 
1551 1551
 To set an installation-wide language preference, set :setting:`LANGUAGE_CODE`.
1552 1552
 Django uses this language as the default translation -- the final attempt if no
1553  
-other translator finds a translation.
  1553
+better matching translation is found by one of the methods employed by the
  1554
+locale middleware (see below).
1554 1555
 
1555  
-If all you want to do is run Django with your native language, and a language
1556  
-file is available for it, all you need to do is set :setting:`LANGUAGE_CODE`.
  1556
+If all you want to do is run Django with your native language all you need to do
  1557
+is set :setting:`LANGUAGE_CODE` and make sure the corresponding :term:`message
  1558
+files <message file>` and their compiled versions (``.mo``) exist.
1557 1559
 
1558 1560
 If you want to let each individual user specify which language he or she
1559  
-prefers, use ``LocaleMiddleware``. ``LocaleMiddleware`` enables language
1560  
-selection based on data from the request. It customizes content for each user.
  1561
+prefers, the you also need to use use the ``LocaleMiddleware``.
  1562
+``LocaleMiddleware`` enables language selection based on data from the request.
  1563
+It customizes content for each user.
1561 1564
 
1562 1565
 To use ``LocaleMiddleware``, add ``'django.middleware.locale.LocaleMiddleware'``
1563 1566
 to your :setting:`MIDDLEWARE_CLASSES` setting. Because middleware order

0 notes on commit 297f5af

Please sign in to comment.
Something went wrong with that request. Please try again.