Carlos Yoder wrote: > Hello there, > > I'm currently developing my first app on Django, and it happens to be > in Slovenia, land in which the beautiful Slovenian language is spoken. > > In this language, the rules of pluralization go very crazy, as the > following example (for the word for 'dolphin') shows: > > 0 delfinov > 1 delfin > 2 delfina > 3 delfini > 3 delfini > 5 delfinov > > So, as you can see, the template tag pluralize falls a little short, > when it faces ancient, little crazy Slavic languages such as this :-) > > How would a newbie to both Python and Django such as me be able to > extend pluralize? Has anyone already faced this? > > Best regards and thanks in advance, >
For full i18n pluralization use: (from http://www.djangoproject.com/documentation/i18n/#pluralization) [ {% blocktrans count list|counted as counter %} There is only one {{ name }} object. {% plural %} There are {{ counter }} {{ name }} objects. {% endblocktrans %} ] And in sl/django(js).po file add: (from http://www.gnu.org/software/gettext/manual/html_chapter/gettext_10.html#SEC150) [ Four forms, special case for one and all numbers ending in 02, 03, or 04 The header entry would look like this: Plural-Forms: nplurals=4; \ plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3; Languages with this property include: Slavic family Slovenian ] You can look for example in sr translation because current sl translation don't have Plural-Forms defined. -- Nebojša Đorđević - nesh Studio Quattro - Niš http://studioquattro.biz/ http://djnesh.blogspot.com/ | http://djnesh-django.blogspot.com/ | http://trac.studioquattro.biz/djangoutils/ Registered Linux User 282159 [http://counter.li.org] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---