Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.5.x] Made description of LANGUAGE_CODE setting more clear.

297f5af from master.
  • Loading branch information...
commit 9a7d59e8c7e90588fc0301fe09c11fbae9ffe1f3 1 parent bbe2ad3
Ramiro Morales authored August 22, 2013
18  docs/ref/settings.txt
@@ -1228,8 +1228,22 @@ LANGUAGE_CODE
1228 1228
 Default: ``'en-us'``
1229 1229
 
1230 1230
 A string representing the language code for this installation. This should be in
1231  
-standard :term:`language format<language code>`. For example, U.S. English is
1232  
-``"en-us"``. See :doc:`/topics/i18n/index`.
  1231
+standard :term:`language ID format <language code>`. For example, U.S. English
  1232
+is ``"en-us"``. See also the `list of language identifiers`_ and
  1233
+:doc:`/topics/i18n/index`.
  1234
+
  1235
+:setting:`USE_I18N` must be active to this setting to have any effect.
  1236
+
  1237
+it serves two purposes:
  1238
+
  1239
+* If the locale middleware isn't in use, it decides which translation is served
  1240
+  to all users.
  1241
+* If the locale middleware is active, it provides the fallback translation when
  1242
+  no translation exist for a given literal to the user preferred language.
  1243
+
  1244
+See :ref:`how-django-discovers-language-preference` for more details.
  1245
+
  1246
+.. _list of language identifiers: http://www.i18nguy.com/unicode/language-identifiers.html
1233 1247
 
1234 1248
 .. setting:: LANGUAGE_COOKIE_NAME
1235 1249
 
13  docs/topics/i18n/translation.txt
@@ -1515,14 +1515,17 @@ should be used -- installation-wide, for a particular user, or both.
1515 1515
 
1516 1516
 To set an installation-wide language preference, set :setting:`LANGUAGE_CODE`.
1517 1517
 Django uses this language as the default translation -- the final attempt if no
1518  
-other translator finds a translation.
  1518
+better matching translation is found by one of the methods employed by the
  1519
+locale middleware (see below).
1519 1520
 
1520  
-If all you want to do is run Django with your native language, and a language
1521  
-file is available for it, all you need to do is set :setting:`LANGUAGE_CODE`.
  1521
+If all you want to do is run Django with your native language all you need to do
  1522
+is set :setting:`LANGUAGE_CODE` and make sure the corresponding :term:`message
  1523
+files <message file>` and their compiled versions (``.mo``) exist.
1522 1524
 
1523 1525
 If you want to let each individual user specify which language he or she
1524  
-prefers, use ``LocaleMiddleware``. ``LocaleMiddleware`` enables language
1525  
-selection based on data from the request. It customizes content for each user.
  1526
+prefers, the you also need to use use the ``LocaleMiddleware``.
  1527
+``LocaleMiddleware`` enables language selection based on data from the request.
  1528
+It customizes content for each user.
1526 1529
 
1527 1530
 To use ``LocaleMiddleware``, add ``'django.middleware.locale.LocaleMiddleware'``
1528 1531
 to your :setting:`MIDDLEWARE_CLASSES` setting. Because middleware order

0 notes on commit 9a7d59e

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