Django

Code

Ticket #719 (closed: fixed)

Opened 3 years ago

Last modified 3 years ago

[i18n] bugs in templatetags/i18n.py

Reported by: Nebojša Đorđević - nesh <nesh@studioquattro.co.yu> Assigned to: adrian
Milestone: Component: Core framework
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

some typos found:

Index: /store/django/django/templatetags/i18n.py
===================================================================
--- /store/django/django/templatetags/i18n.py	(revision 1062)
+++ /store/django/django/templatetags/i18n.py	(working copy)
@@ -18,7 +18,7 @@
         context[self.variable] = LANGUAGES
         return ''
 
-class GetCurrentLanguage(Node):
+class GetCurrentLanguageNode(Node):
 
     def __init__(self, variable):
         self.variable = variable
@@ -112,7 +112,7 @@
     args = token.contents.split()
     if len(args) != 3 or args[1] != 'as':
         raise TemplateSyntaxError, "'get_available_languages' requires 'as variable' (got %r)" % args
-    return GetAvailableLanguagesNode(args[2])
+    return GetCurrentLanguageNode(args[2])
 
 def do_translate(parser, token):
     """
@@ -189,7 +189,7 @@
             singular.append(token)
         else:
             break
-    if countervar and counter:  
+    if countervar and counter:
         if token.contents.strip() != 'plural':
             raise TemplateSyntaxError, "'blocktrans' doesn't allow other block tags inside it" % tag
         while parser.tokens:
@@ -200,11 +200,11 @@
                 break
     if token.contents.strip() != 'endblocktrans':
         raise TemplateSyntaxError, "'blocktrans' doesn't allow other block tags (seen %r) inside it" % token.contents
-    
+
     return BlockTranslateNode(extra_context, singular, plural, countervar, counter)
 
 register_tag('get_available_languages', do_get_available_languages)
-register_tag('get_curent_language', do_get_current_language)
+register_tag('get_current_language', do_get_current_language)
 register_tag('trans', do_translate)
 register_tag('blocktrans', do_block_translate)
 

Attachments

i18n.diff (1.7 kB) - added by Nebojša Đorđević - nesh <nesh@studioquattro.co.yu> on 11/03/05 06:25:16.
diff again

Change History

11/03/05 06:25:16 changed by Nebojša Đorđević - nesh <nesh@studioquattro.co.yu>

  • attachment i18n.diff added.

diff again

11/03/05 10:07:49 changed by hugo

  • status changed from new to closed.
  • resolution set to fixed.

(In [1064]) i18n: updated unittests and fixed bugs in the tags, removed the old tags and fixed #719 (thx nesh)


Add/Change #719 ([i18n] bugs in templatetags/i18n.py)




Change Properties
Action