Hi all,
I'm having problems understanding an error that raises with gettext and an
accented letter. Italian translation of 'priority' is 'priorità', the text
to be translated is:
subject = _("Priority changed in ticket #%(id)s %(title)s") % (
{'id':instance.id, 'title':instance.title})
that *works nicely* when run in this way:
# coding: latin-1
import os, sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'jobs.settings'
from django.utils.translation import gettext as _
subject = _("Priority changed in ticket #%(id)s %(title)s") % (
{'id': 11, 'title': 'abc'})
but raises an error when run within a function in a callback connected
with a signal:
Traceback (most recent call last):
File "/home/sandro/src/django/jungle/apps/ticket/views.py" in update
40. return generic.update_object(request, model, ext="_update", **kw)
File "/home/sandro/src/django/jungle/views/mgeneric.py" in update_object
62. return create_update.update_object(request, model, **kw)
File "/home/sandro/src/django/jungle/views/create_update.py" in update_object
146. object = form.save()
File "/misc/src/django/trunk/django/newforms/models.py" in save
65. return save_instance(self, instance, commit)
File "/misc/src/django/trunk/django/newforms/models.py" in save_instance
53. instance.save()
File "/misc/src/django/trunk/django/db/models/base.py" in save
250. dispatcher.send(signal=signals.post_save, sender=self.__class__,
instance=self)
File "/misc/src/django/trunk/django/dispatch/dispatcher.py" in send
358. sender=sender,
File "/home/sandro/src/django/jungle/apps/ticket/jsignals.py" in mail_on_change
78. subject = _("Priority changed in ticket #%(id)s %(title)s") % (
UnicodeDecodeError at /ticket/ticket/edit/21/
'ascii' codec can't decode byte 0xc3 in position 7: ordinal not in
range(128)
my understnding of the problem is clearly partial here. I don't
understand what changes when the function in run within django.
Any hint?
thanks in advance
sandro
*:-)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---