问题
I've looked at this question: Django: gettext raises ValueError: 'plural forms expression could be dangerous' and while it helps me understand the issue it doesn't solve it.
I have a pretty vanilla django-cms install, and one of the languages needs to be Polish, a language with more than one plural form.
I've been looking at how to fix this, but haven't gotten very far. django-cms
uses an app for hierarchical trees called mptt
and this is the first (and only?) application it trips on, while running the django.mo file for the pl locale.
See the traceback here: http://dpaste.com/684737/
回答1:
It looks like the following line wasn't removed in the 0.5.1 install of django-mptt:
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
The changeset can be found here: https://github.com/django-mptt/django-mptt/commit/4b6a9758396450651bc2d02b2c7d49bac6cd3f25
This issue has been fixed as of 0.5.2 and upgrading to this version makes the error go away.
来源:https://stackoverflow.com/questions/8793513/plural-forms-expression-could-be-dangerous