Hi Malcolm,

Thanks for your detailed answer.

Le 7 janv. 09 à 02:54, Malcolm Tredinnick a écrit :
> Using (u)ngettext as inspiration for a solution might provoke some
> ideas. That precise API would look a bit ugly in templates, but there
> might be something that falls out of the sky when you think along  
> those
> lines.

The sky was really cloudy after reading your link but hopefully, I  
found this one:
http://scratchpad.cmlenz.net/c8e1af24481df087217bf12a57862949/

My proposition is to get a human readable dictionary between locales  
and expressions:
{ 'en': '(n != 1)', 'fr': '(n>1)', and so on }
and then to add a l10n argument to pluralize (naive first iteration  
for the syntax):
d{% comment_count|pluralize:"u,es,l10n=fr" %} commentaire{%  
comment_count|pluralize:"l10n=fr" %}
It looks simple and functional but I'm afraid that it will impact  
performances... I can provide a benchmark to verify but let's discuss  
at first :-)

Regards,
David


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django I18N" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Django-I18N?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to