【问题标题】:Where is the function 'real_ugettext' in django?django 中的函数“real_ugettext”在哪里?
【发布时间】:2010-01-20 08:45:31
【问题描述】:

django.utils.translations.__init__.py:

def ugettext(message):
    return real_ugettext(message)

我找不到。

【问题讨论】:

    标签: python django


    【解决方案1】:

    请仔细阅读that file

    def delayed_loader(*args, **kwargs):
        """
        Replace each real_* function with the corresponding function from either
        trans_real or trans_null (e.g. real_gettext is replaced with
        trans_real.gettext or trans_null.gettext). This function is run once, the
        first time any i18n method is called. It replaces all the i18n methods at
        once at that time.
        """
        #...
    

    【讨论】:

      【解决方案2】:

      Django 做了一些令人讨厌的全局修改魔法,以便用同一包中的 trans_real 或 trans_null 中的 ugettext 替换它。

      【讨论】:

        猜你喜欢
        • 2010-10-28
        • 1970-01-01
        • 2011-03-18
        • 2010-09-16
        • 2015-01-21
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多