﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
17632	new filter for localflavor 'The Netherlands'	lkeijser	nobody	"I've created a small filter that can be used in the same way as 'pluralize'. It basically adds 'en' (most common pluralized word in Dutch) when used.

{{{#!python
from django import template
from django.template.defaultfilters import stringfilter

register = template.Library()

@register.filter
def meervoud(value, arg=u'en'):
    if not u',' in arg:
        arg = u',' + arg
    bits = arg.split(u',')
    if len(bits) > 2:
        return u''
    singular_suffix, plural_suffix = bits[:2]

    try:
        if int(value) != 1:
            return plural_suffix
    except ValueError: # Invalid string that's not a number.
        pass
    except TypeError: # Value isn't a string or a number; maybe it's a list?
        try:
            if len(value) != 1:
                return plural_suffix
        except TypeError: # len() of unsized object.
            pass
    return singular_suffix
}}}"	New feature	closed	contrib.localflavor	1.3	Normal	wontfix			Accepted	0	1	1	0	0	0
