#7834 closed defect (fixed)
AttributeError: 'function' object has no attribute 'ugettext'
| Reported by: | Owned by: | Christian Boos | |
|---|---|---|---|
| Priority: | highest | Milestone: | 0.12 |
| Component: | general | Version: | devel |
| Severity: | normal | Keywords: | i18n |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
Hello,
i installed Trac (Trac-0.12dev_r7715-py2.5.egg) via
sudo easy_install http://svn.edgewall.org/repos/trac/trunk
and Genshi (Genshi 0.6dev-r960) via
sudo easy_install Genshi
and Babel (Babel-0.9.4-py2.5.egg) via
sudo easy_install Babel
Now i got the following error:
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7715-py2.5.egg/trac/web/api.py", line 375, in send_error
data, 'text/html')
File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7715-py2.5.egg/trac/web/chrome.py", line 741, in render_template
return stream.render(method, doctype=doctype)
File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/core.py", line 179, in render
return encode(generator, method=method, encoding=encoding, out=out)
File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/output.py", line 56, in encode
return _encode(u''.join(list(iterator)))
File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/output.py", line 307, in __call__
for kind, data, pos in stream:
File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/output.py", line 749, in __call__
for kind, data, pos in stream:
File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/output.py", line 588, in __call__
for kind, data, pos in stream:
File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/output.py", line 694, in __call__
for kind, data, pos in chain(stream, [(None, None, None)]):
File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/output.py", line 528, in __call__
for ev in stream:
File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/core.py", line 267, in _ensure
event = stream.next()
File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/core.py", line 267, in _ensure
event = stream.next()
File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7715-py2.5.egg/trac/web/chrome.py", line 793, in _strip_accesskeys
for kind, data, pos in stream:
File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/core.py", line 267, in _ensure
event = stream.next()
File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7715-py2.5.egg/trac/web/chrome.py", line 782, in _generate
for kind, data, pos in stream:
File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/template/base.py", line 603, in _include
for event in stream:
File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/template/markup.py", line 330, in _match
for event in stream:
File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/template/base.py", line 577, in _exec
for event in stream:
File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/template/base.py", line 530, in _eval
for kind, data, pos in stream:
File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/template/base.py", line 585, in _flatten
for event in stream:
File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/filters/i18n.py", line 181, in __call__
gettext = self.translate.ugettext
AttributeError: 'function' object has no attribute 'ugettext'
On Ubuntu 8.10 with Apache + mod_python.
Attachments (0)
Change History (8)
comment:1 by , 17 years ago
comment:2 by , 17 years ago
Ok, thanks. This solves the exception. But the localization still does not work.
comment:3 by , 17 years ago
Ok, Isee, it's the Babel + Genshi trunk combination which doesn't work. Babel + Genshi 0.5.1 won't work either.
For making the localization work, you should compile the catalogs. Have a look at 0.12/TracInstall, near the end of that section.
follow-up: 6 comment:4 by , 17 years ago
| Keywords: | i18n added |
|---|---|
| Resolution: | → fixed |
| Status: | new → closed |
comment:5 by , 17 years ago
I should have kept all fixes together as [7726] is also needed for Genshi trunk / no Babel.
comment:6 by , 17 years ago
The following configurations work now:
- Genshi 0.5.1
That is, on pages that didn't involve using the i18n:msg attribute in templates. See #7728.
comment:7 by , 17 years ago
| Owner: | set to |
|---|
comment:8 by , 16 years ago
| Priority: | normal → highest |
|---|
Still broekn!
Traceback (most recent call last):
File "/usr/local/bin/tracd", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2566, in <module>
parse_requirements(requires), Environment()
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 524, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: Genshi≥0.6dev



For proper operation on trunk you need Genshi:branches/experimental/advanced-i18n, from svn (
svn co http://svn.edgewall.org/repos/genshi/branches/experimental/advanced-i18n).I'll try to see if we can make it at least not break with genshi trunk (it should not break with 0.5.1, it seems).