Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django: gettext raises ValueError: 'plural forms expression could be dangerous'

If a auto generated django.po file contains the following line in its header

"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"

"manage.py runserver" raises

gettext.py", line 93, in c2py
raise ValueError, 'plural forms expression could be dangerous'
ValueError: plural forms expression could be dangerous

If i remove the line everything works. What does the header mean? Why is it somtimes generated (for example localisation of the haystack app)? What das the error message mean?

like image 279
Lenz Hirsch Avatar asked Nov 15 '22 03:11

Lenz Hirsch


1 Answers

It means that your translator forgot to fill it in properly.

like image 171
Ignacio Vazquez-Abrams Avatar answered Dec 26 '22 08:12

Ignacio Vazquez-Abrams