La version 5 de Planète Casio. Regroupe le forum, les programmes, les tutoriel, les sprites et tous les autres outils développés par nos soins.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pluralize.py 398B

1234567891011
  1. from app import app
  2. @app.template_filter('pluralize')
  3. def pluralize(count, singular="", plural="s"):
  4. """
  5. Make a noun plural. Meant for templates; use it like this:
  6. Il y a {{ n }} groupe{{ n | pluralize }}.
  7. You can specify different suffixes if "s" is not relevant;
  8. Il y a {{ n }} hibou{{ n | pluralize("", "x") }}.
  9. """
  10. return singular if count <= 1 else plural