Skip to content

Commit

Permalink
Fixed #14669 -- corrected an ungrammatical sentence in the internatio…
Browse files Browse the repository at this point in the history
…nalization docs. Thanks to steveire for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
Gabriel Hurley committed Nov 12, 2010
1 parent ee6bec6 commit b951ffb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/topics/i18n/internationalization.txt
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ The strings you pass to ``_()`` or ``ugettext()`` can take placeholders,
specified with Python's standard named-string interpolation syntax. Example:: specified with Python's standard named-string interpolation syntax. Example::


def my_view(request, m, d): 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) return HttpResponse(output)


This technique lets language-specific translations reorder the placeholder 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 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``) For this reason, you should use named-string interpolation (e.g., ``%(day)s``)
instead of positional interpolation (e.g., ``%s`` or ``%d``) whenever you instead of positional interpolation (e.g., ``%s`` or ``%d``) whenever you
Expand Down

0 comments on commit b951ffb

Please sign in to comment.