summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2005-11-13 00:19:16 +0000
committerAdrian Holovaty <adrian@holovaty.com>2005-11-13 00:19:16 +0000
commitf7d2e9ea9f0d9bba38553f21cfe3f1a821916374 (patch)
treecb26711e0775ed41cb60b12269eadb0c738b90ab
parentf3319e45e4aaceb9caaa5c5fe2a96fc6eac39884 (diff)
downloaddjango-f7d2e9ea9f0d9bba38553f21cfe3f1a821916374.tar.gz
Grammar cleanups for recent documentation and docstring changes.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1209 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/utils/translation.py4
-rw-r--r--docs/i18n.txt15
-rw-r--r--docs/settings.txt33
3 files changed, 38 insertions, 14 deletions
diff --git a/django/utils/translation.py b/django/utils/translation.py
index 426faaaff0..90b4ed375d 100644
--- a/django/utils/translation.py
+++ b/django/utils/translation.py
@@ -256,7 +256,7 @@ ngettext_lazy = lazy(ngettext, str)
def check_for_language(lang_code):
"""
Checks whether there is a global language file for the given language code.
- This is used to decide whether a user-provided language is available. this is
+ This is used to decide whether a user-provided language is available. This is
only used for language codes from either the cookies or session.
"""
from django.conf import settings
@@ -327,7 +327,7 @@ def get_language_from_request(request):
def get_date_formats():
"""
- This function checks wether translation files provide a translation for some
+ This function checks whether translation files provide a translation for some
technical message ID to store date and time formats. If it doesn't contain
one, the formats provided in the settings will be used.
"""
diff --git a/docs/i18n.txt b/docs/i18n.txt
index 3ed95007fc..2bf5535f0a 100644
--- a/docs/i18n.txt
+++ b/docs/i18n.txt
@@ -426,18 +426,21 @@ Notes:
Django uses the base language. For example, if a user specifies ``de-at``
(Austrian German) but Django only has ``de`` available, Django uses
``de``.
- * only languages listed in the LANGUAGES setting can be selected. So if you want
- to restrict the language selection to a subset of provided languages (because
- your appliaction doesn't provide all those languages), just set it to a list
- of languages like this::
+ * Only languages listed in the `LANGUAGES setting`_ can be selected. If
+ you want to restrict the language selection to a subset of provided
+ languages (because your appliaction doesn't provide all those languages),
+ set ``LANGUAGES`` to a list of languages. For example::
LANGUAGES = (
('de', _('German')),
('en', _('English')),
)
- This would restrict the available languages for automatic selection to German
- and English (and any sublanguage of those, like de-ch or en-us).
+ This example restricts languages that are available for automatic
+ selection to German and English (and any sublanguage, like de-ch or
+ en-us).
+
+ .. _LANGUAGES setting: http://www.djangoproject.com/documentation/settings/#languages
Once ``LocaleMiddleware`` determines the user's preference, it makes this
preference available as ``request.LANGUAGE_CODE`` for each `request object`_.
diff --git a/docs/settings.txt b/docs/settings.txt
index d2f6ffcdb5..fbce44807a 100644
--- a/docs/settings.txt
+++ b/docs/settings.txt
@@ -403,12 +403,33 @@ in standard language format. For example, U.S. English is ``"en-us"``. See the
LANGUAGES
---------
-Default: a list of available languages and their name
-
-This is a list of two-tuples with language code and language name that are available
-for language selection. See the `internationalization docs`_ for details. It usually
-isn't defined, only if you want to restrict language selection to a subset of the
-django-provided languages you need to set it.
+Default: A tuple of all available languages. Currently, this is::
+
+ LANGUAGES = (
+ ('bn', _('Bengali')),
+ ('cs', _('Czech')),
+ ('cy', _('Welsh')),
+ ('de', _('German')),
+ ('en', _('English')),
+ ('es', _('Spanish')),
+ ('fr', _('French')),
+ ('gl', _('Galician')),
+ ('it', _('Italian')),
+ ('no', _('Norwegian')),
+ ('pt-br', _('Brazilian')),
+ ('ro', _('Romanian')),
+ ('ru', _('Russian')),
+ ('sk', _('Slovak')),
+ ('sr', _('Serbian')),
+ ('zh-cn', _('Simplified Chinese')),
+ )
+
+A tuple of two-tuples in the format (language code, language name). This
+specifies which languages are available for language selection. See the
+`internationalization docs`_ for details.
+
+Generally, the default value should suffice. Only set this setting if you want
+to restrict language selection to a subset of the Django-provided languages.
MANAGERS
--------