Created
December 18, 2012 20:43
-
-
Save whatisjasongoldstein/4331779 to your computer and use it in GitHub Desktop.
Bug, docs issue, or my being stupid? (Translations behave differently when imported as _)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'] | |
In [10]: from django.utils.translation import ugettext as foo | |
In [11]: [foo('red'), foo('blue')] | |
Out[11]: [u'red', u'blue'] | |
In [12]: [foo('red'), foo('blue')] | |
Out[12]: [u'red', u'blue'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment