tags:

views:

45

answers:

2

In django.utils.translations.__init__.py:

def ugettext(message):
    return real_ugettext(message)

I can't find it.

A: 

Django does some nasty global-munging magic in order to replace it with ugettext from either trans_real or trans_null found in the same package.

Ignacio Vazquez-Abrams
+3  A: 

Read that file a little closer:

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.
    """
    #...
Oli