summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorGeorg Bauer <gb@hugo.westfalen.de>2005-10-17 19:34:12 +0000
committerGeorg Bauer <gb@hugo.westfalen.de>2005-10-17 19:34:12 +0000
commita26e6a4d75062fef392440ec80e9331be5fbf12b (patch)
treea0d155f21c938d09fc8bc1a586ab0a56ffd349b7 /docs
parent2070258460a566e9f4c1afb62e185b5c4e0c26d7 (diff)
i18n: updated translation doc to reflect the django_language and LANGUAGE_CODE format change
git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@915 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/translation.txt22
1 files changed, 19 insertions, 3 deletions
diff --git a/docs/translation.txt b/docs/translation.txt
index 0397374568..534563b881 100644
--- a/docs/translation.txt
+++ b/docs/translation.txt
@@ -85,7 +85,23 @@ This way only a lazy reference is stored for the string, not the actual translat
The translation itself will be done when the string is used in a string context, like
template rendering in the admin.
-There is a standard problem with translations, that is pluralization of
+If you don't like the verbose name gettext_lazy, you can just alias it as _ - in the model
+file you will allways use lazy translations anyway. And it's a good idea to add translations
+for the field names and table names, too. This means writing explicit verbose_name and
+verbose_names options in the META subclass, though::
+
+ from django.utils.translation import gettext_lazy as _
+
+ class Mything(meta.Model):
+
+ name = meta.CharField(_('Name'), help_text=_('This is the help text'))
+
+ class META:
+
+ verbose_name = _('Mything')
+ verbose_name_plural = _('Mythings')
+
+There is another standard problem with translations, that is pluralization of
strings. This is done by the standard helper ngettext like so::
def hello_world(request, count):
@@ -199,9 +215,9 @@ setting, the middleware will look at the cookies for a django_language cookie.
If that is found, it gives the language code.
The format for the explicit django_language parameters is allways the
-locale to use - for example it's pt_BR for Brazilian. If a base language
+language to use - for example it's pt-br for Brazilian. If a base language
is available, but the sublanguage specified is not, the base language is used.
-For example if you specify de_AT (Austrian German), but there is only a
+For example if you specify de-at (Austrian German), but there is only a
language de available, that language is used.
If neither the session nor the cookie carry a language code, the middleware