Skip to content

Commit

Permalink
[2.2.x] Refs #20122 -- Corrected documentation of pluralize template …
Browse files Browse the repository at this point in the history
…filter.

Backport of e3968df from master
  • Loading branch information
rixx authored and felixxm committed May 3, 2019
1 parent 2166fe3 commit bf9e0e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions django/template/defaultfilters.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,8 +851,8 @@ def filesize_number_format(value):
@register.filter(is_safe=False)
def pluralize(value, arg='s'):
"""
Return a plural suffix if the value is not 1. By default, use 's' as the
suffix:
Return a plural suffix if the value is not 1, '1', or an object of
length 1. By default, use 's' as the suffix:
* If value is 0, vote{{ value|pluralize }} display "votes".
* If value is 1, vote{{ value|pluralize }} display "vote".
Expand Down
4 changes: 2 additions & 2 deletions docs/ref/templates/builtins.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1992,8 +1992,8 @@ If ``value`` is ``800-COLLECT``, the output will be ``800-2655328``.
``pluralize``
-------------

Returns a plural suffix if the value is not 1. By default, this suffix is
``'s'``.
Returns a plural suffix if the value is not ``1``, ``'1'``, or an object of
length 1. By default, this suffix is ``'s'``.

Example::

Expand Down

0 comments on commit bf9e0e3

Please sign in to comment.