复数形式表达可能是危险的 [英] plural forms expression could be dangerous
问题描述
我已经看过这个问题: Django :gettext引发ValueError:'复数形式表达式可能是危险的',而它可以帮助我理解它不能解决的问题。
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.
我有一个漂亮的香草 django-cms 一个>安装,其中一个语言需要是波兰语,一个多于一个复数形式的语言。
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.
我一直在寻找如何解决这个问题,但是没有得到很远。 django-cms
使用一个名为 mptt
的层次树的应用程序,这是第一个(而且只有)应用程序在运行 pl 区域设置的django.mo文件时。
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.
在此处查看回溯: http://dpaste.com/684737/
推荐答案
看起来像在0.5.1安装django-mptt中没有删除以下行:
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"
可以在这里找到更改集: https://github.com / django-mptt / django-mptt / commit / 4b6a9758396450651bc2d02b2c7d49bac6cd3f25
The changeset can be found here: https://github.com/django-mptt/django-mptt/commit/4b6a9758396450651bc2d02b2c7d49bac6cd3f25
此问题已修复为0.5.2,升级到此版本会使错误发生离开。
This issue has been fixed as of 0.5.2 and upgrading to this version makes the error go away.
这篇关于复数形式表达可能是危险的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!