diff options
| author | Gabriel Hurley <gabehr@gmail.com> | 2010-11-12 02:48:26 +0000 |
|---|---|---|
| committer | Gabriel Hurley <gabehr@gmail.com> | 2010-11-12 02:48:26 +0000 |
| commit | b951ffbc6bba6ea96f8b633782d02b983ec21e84 (patch) | |
| tree | 817b885296cfa270d96df50002fd69933bac68a2 /docs | |
| parent | ee6bec6c092da5466be563cef1ecf3bcc45199f6 (diff) | |
Fixed #14669 -- corrected an ungrammatical sentence in the internationalization docs. Thanks to steveire for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/topics/i18n/internationalization.txt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/topics/i18n/internationalization.txt b/docs/topics/i18n/internationalization.txt index ba13abd1e0..583f53e007 100644 --- a/docs/topics/i18n/internationalization.txt +++ b/docs/topics/i18n/internationalization.txt @@ -87,13 +87,13 @@ The strings you pass to ``_()`` or ``ugettext()`` can take placeholders, specified with Python's standard named-string interpolation syntax. Example:: def my_view(request, m, d): - output = _('Today is %(month)s, %(day)s.') % {'month': m, 'day': d} + output = _('Today is %(month)s %(day)s.') % {'month': m, 'day': d} return HttpResponse(output) This technique lets language-specific translations reorder the placeholder -text. For example, an English translation may be ``"Today is November, 26."``, +text. For example, an English translation may be ``"Today is November 26."``, while a Spanish translation may be ``"Hoy es 26 de Noviembre."`` -- with the -placeholders (the month and the day) with their positions swapped. +the month and the day placeholders swapped. For this reason, you should use named-string interpolation (e.g., ``%(day)s``) instead of positional interpolation (e.g., ``%s`` or ``%d``) whenever you |
