Problem using ungettext for plural forms in JQuery

29 views
Skip to first unread message

Rahul Bhalerao

unread,
Oct 4, 2013, 6:25:16 AM10/4/13
to python...@googlegroups.com
Hi,

I am using babel with pylons and mako templates. We are using jquery in the mako templates.
One of the strings has to have plural forms hence we tried to use ungettext for proper plural string extraction. But most of the standard syntax did not work. Hence we used the following syntax with sprintf in mako template:

var r = confirm(sprintf("${ungettext('Do you want to delete this %d object?', 'Do  you want to delete these %d objects?', count)}",count));

After this, there were no syntactical errors or javascript console messages. But whenever the string has to be singular, i.e. count = 1, it still uses the plural string and outputs comething like this:
 "'Do  you want to delete these 1 objects?"

Does anyone know what is going wrong? Why even though the count variable has singular value, and is being shown so, still the string chosen is plural?

Regards,
Rahul.
Reply all
Reply to author
Forward
0 new messages