Code

Ticket #719: i18n.diff

File i18n.diff, 1.7 KB (added by Nebojša Đorđević - nesh <nesh@…>, 9 years ago)

diff again

Line 
1Index: /store/django/django/templatetags/i18n.py
2===================================================================
3--- /store/django/django/templatetags/i18n.py   (revision 1062)
4+++ /store/django/django/templatetags/i18n.py   (working copy)
5@@ -18,7 +18,7 @@
6         context[self.variable] = LANGUAGES
7         return ''
8 
9-class GetCurrentLanguage(Node):
10+class GetCurrentLanguageNode(Node):
11 
12     def __init__(self, variable):
13         self.variable = variable
14@@ -112,7 +112,7 @@
15     args = token.contents.split()
16     if len(args) != 3 or args[1] != 'as':
17         raise TemplateSyntaxError, "'get_available_languages' requires 'as variable' (got %r)" % args
18-    return GetAvailableLanguagesNode(args[2])
19+    return GetCurrentLanguageNode(args[2])
20 
21 def do_translate(parser, token):
22     """
23@@ -189,7 +189,7 @@
24             singular.append(token)
25         else:
26             break
27-    if countervar and counter: 
28+    if countervar and counter:
29         if token.contents.strip() != 'plural':
30             raise TemplateSyntaxError, "'blocktrans' doesn't allow other block tags inside it" % tag
31         while parser.tokens:
32@@ -200,11 +200,11 @@
33                 break
34     if token.contents.strip() != 'endblocktrans':
35         raise TemplateSyntaxError, "'blocktrans' doesn't allow other block tags (seen %r) inside it" % token.contents
36-   
37+
38     return BlockTranslateNode(extra_context, singular, plural, countervar, counter)
39 
40 register_tag('get_available_languages', do_get_available_languages)
41-register_tag('get_curent_language', do_get_current_language)
42+register_tag('get_current_language', do_get_current_language)
43 register_tag('trans', do_translate)
44 register_tag('blocktrans', do_block_translate)
45