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

◇◆丶佛笑我妖孽 提交于 2019-12-19 03:24:15

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/4935704/django-gettext-raises-valueerror-plural-forms-expression-could-be-dangerous

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!