set language from user lang in DB?

55 views
Skip to first unread message

galgal

unread,
Jun 21, 2011, 7:23:30 PM6/21/11
to django...@googlegroups.com

What is the best way to set language that is in DB in UserProfile? I have option to select language for users and after selecting it, I update UserProfile table to set the language. While logging in, i need to get user language from his profile and set it. User changes are made by selecting options from list of languages.

How can I dod that in the best way?

Kevin Renskers

unread,
Jun 22, 2011, 8:17:33 AM6/22/11
to django...@googlegroups.com
from django.utils import translation
translation.activate(language_code)

Reply all
Reply to author
Forward
0 new messages