plural forms expression could be dangerous

大憨熊 提交于 2020-02-04 03:55:09

问题


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

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