I think the google_translate method needs to be updated. It seems like
the regexp cannot find the textarea tags anymore (Google has probably
updated their webpage).

I changed the regexp in google_translate in turbogears/i18n/utils.py
to:

    match = re.compile('<textarea name=utrans.*?>(.*?)</textarea>',
                       re.DOTALL).search(s)

But now I am getting errors like:
Page handler: <function _wrapper at 0xa5f29cc>
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/CherryPy-2.3.0-py2.5.egg/
cherrypy/_cphttptools.py", line 121, in _run
    self.main()
  File "/usr/lib/python2.5/site-packages/CherryPy-2.3.0-py2.5.egg/
cherrypy/_cphttptools.py", line 264, in main
    body = page_handler(*virtual_path, **self.params)
  File "/usr/lib/python2.5/site-packages/TurboGears-1.0.5-py2.5.egg/
turbogears/identity/conditions.py", line 241, in _wrapper
    return fn(*args, **kw)
  File "<string>", line 3, in po_view
  File "/usr/lib/python2.5/site-packages/TurboGears-1.0.5-py2.5.egg/
turbogears/controllers.py", line 359, in expose
    *args, **kw)
  File "<string>", line 5, in run_with_transaction
  File "/usr/lib/python2.5/site-packages/TurboGears-1.0.5-py2.5.egg/
turbogears/database.py", line 358, in so_rwt
    retval = func(*args, **kw)
  File "<string>", line 5, in _expose
  File "/usr/lib/python2.5/site-packages/TurboGears-1.0.5-py2.5.egg/
turbogears/controllers.py", line 372, in <lambda>
    mapping, fragment, args, kw)))
  File "/usr/lib/python2.5/site-packages/TurboGears-1.0.5-py2.5.egg/
turbogears/controllers.py", line 401, in _execute_func
    output = errorhandling.try_call(func, *args, **kw)
  File "/usr/lib/python2.5/site-packages/TurboGears-1.0.5-py2.5.egg/
turbogears/errorhandling.py", line 77, in try_call
    return func(self, *args, **kw)
  File "/usr/lib/python2.5/site-packages/TurboGears-1.0.5-py2.5.egg/
turbogears/toolbox/admi18n/__init__.py", line 142, in po_view
    self.google_translate(code, from_lang, to_lang, kargs)
  File "/usr/lib/python2.5/site-packages/TurboGears-1.0.5-py2.5.egg/
turbogears/toolbox/admi18n/__init__.py", line 127, in google_translate
    catalog.update(path, msg_id, translated)
  File "/usr/lib/python2.5/site-packages/TurboGears-1.0.5-py2.5.egg/
turbogears/toolbox/admi18n/catalog.py", line 102, in update
    return pygettext.escape_unicode(msg)
  File "/usr/lib/python2.5/site-packages/TurboGears-1.0.5-py2.5.egg/
turbogears/toolbox/admi18n/catalog.py", line 83, in save
    backup_name = path.replace('.po', '.back')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
22: ordinal not in range(128)

Anyone got any ideas what went wrong?

Best regards,
Jesper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to