Skip to content

Instantly share code, notes, and snippets.

Created December 18, 2012 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/4331766 to your computer and use it in GitHub Desktop.
Save anonymous/4331766 to your computer and use it in GitHub Desktop.
Bug with Django translations, issue with documentation, or me being stupid?
In [1]: from django.utils.translation import ugettext as _
In [2]: [_('red'),_('blue')]
Out[2]: [u'red', u'blue']
In [3]: [_('red'),_('blue')]
TypeError Traceback (most recent call last)
/Users/jg026715/.virtualenvs/iqh/lib/python2.7/site-packages/django/core/management/commands/shell.pyc in <module>()
----> 1 [_('red'),_('blue')]
TypeError: 'list' object is not callable
In [4]: [_('red'),_('blue')]
KeyboardInterrupt
In [4]: from django.utils.translation import ugettext
In [5]: [ugettext('red'),ugettext('blue')]
Out[5]: [u'red', u'blue']
In [6]: [ugettext('red'),ugettext('blue')]
Out[6]: [u'red', u'blue']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment