﻿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
6355	Interpolate function of i18n for javascript is incorrectly documented	Maciej Wiśniowski	nobody	"Docs at: http://www.djangoproject.com/documentation/i18n/ gives following example:
{{{
d = {
    count: 10
};
s = interpolate(ungettext('this is %(count)s object', 'this are %(count)s objects', d.count), d);
}}}

but, according to interpolate definition:

{{{
function interpolate(fmt, obj, named) {
    if (named) {
        return fmt.replace(/%\(\w+\)s/g, function(match){return String(obj[match.slice(2,-2)])});
    } else {
        return fmt.replace(/%s/g, function(match){return String(obj.shift())});
    }
}
}}}

there should be third parameter (named) in call to interpolate. Otherwise it always tries to do positional substitution Like:
{{{

d = {
    count: 10
};
s = interpolate(ungettext('this is %(count)s object', 'this are %(count)s objects', d.count), d, true);

}}}"		closed	Documentation	dev		duplicate	interpolate i18n javascript	pigletto@…	Accepted	0	0	0	0	0	0
