Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Dec. 3, 2010 19:04:57

Joakim H.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Debug internalization


Hello,

I am trying to use Djangos internalization framework - but struggling
a bit ...

In my settings.py file I have:

LANGUAGES = (
("en" , ugettext("English")),
("no" , ugettext("Norwegian")),
("sv" , ugettext("Swedish")),
("dk" , ugettext("Danish")))

LANGUAGE_CODE = 'en-us'


MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
.....


In my view I have:


from django.utils.translation import ugettext

def view_local(request):
msg = ugettext("Local message")
return render_to_context(....)


Now my problem is that the ugettext() function will only return the
literal input string, whatever I pass it. In the beginning I of course
passed in strings I had a translation for, but e.g.

msg = ugettext("Message_without_any_translation")

will just work "fine". So I guess I wonder if it is possible to get
some debug info from this, i.e. in development mode I would prefer the
ugettext() function to crash and burn if the msgid can not be found
instead of just return the msgid. Any tips on this?



Regards Joakim




--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 17th of August
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support