@register.tag
def language(parser, token):
 bits = token.split_contents()
 if (len(bits) != 2):
  raise TemplateSyntaxError(("'%s' takes one argument (language)" % bits[0]))
 language = parser.compile_filter(bits[1])
 nodelist = parser.parse(('endlanguage',))
 parser.delete_first_token()
 return LanguageNode(nodelist, language)

@ register . tag def language ( parser , token ) : bits = token . split_contents ( ) if ( len ( bits ) != 2 ) : raise TemplateSyntaxError ( ( "'%s' takes one argument (language)" % bits [ 0 ] ) ) language = parser . compile_filter ( bits [ 1 ] ) nodelist = parser . parse ( ( 'endlanguage' , ) ) parser . delete_first_token ( ) return LanguageNode ( nodelist , language )
this will enable the given language just for this block .