Sunday, April 19, 2015

Django translation in views

myapp/views.py:

from django.utils.translation import ugettext

def getOptDict():
    optArr = {
        1: ugettext('Test 1'),
        2: ugettext('Test 2'),
    }
    return optArr

No comments: