且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

django:使用admin datepicker

更新时间:2023-11-30 16:23:34

不,这不是一个bug。

No, it's not a bug.

它试图在js中调用gettext()国际化功能。你可以像python代码或模板一样做js国际化,这只是一个不太了解的功能。

It's trying to call the gettext() internationalization function in js. You can do js internationalization much like you do it in python code or templates, it's only a less known feature.

如果你不在项目中使用js国际化

If you don't use js internationalization in your project you can just put.

<script>function gettext(txt){ return txt }</script>

在您的顶层模板中,所以js解释器不会窒息。

in your top template so the js interpreter doesn't choke.

这是一个奇怪的方式来解决我知道的。

This is a hacky way to solve it I know.

编辑:

或者您可以包括确切的jsi18n js django管理员参考,以使其工作甚至与其他语言。我不知道是哪一个。

Or you can include the exact jsi18n js django admin references to get it working even with other languages. I don't know which one it is.

今天在django-users上发布了:

This was posted on django-users today:

http://groups.google.com/group/django-users/ browse_thread / thread / 2f529966472c479d#

无论如何,也许是你,以防万一。

Maybe it was you, anyway, just in case.