Где функция 'real_ugettext' в Django? - PullRequest
0 голосов
/ 20 января 2010

В django.utils.translations.__init__.py:

def ugettext(message):
    return real_ugettext(message)

Я не могу его найти.

Ответы [ 2 ]

4 голосов
/ 20 января 2010

Читать этот файл чуть ближе:

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.
    """
    #...
0 голосов
/ 20 января 2010

Django совершает чудовищное магическое действие, чтобы заменить его на ugettext из trans_real или trans_null, найденного в том же пакете.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...