Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #15848 -- Fixed regression introduced in [15882] in makemessage…

…s management command when processing multi-line comments that contain non-ASCCI characters in templates. Thanks for the report Denis Drescher.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16038 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 0defa7dc9dc97a11baea3b91158fbc7c57e5c3a6 1 parent d3e5380
Ramiro Morales authored April 18, 2011
6  django/utils/translation/trans_real.py
@@ -435,16 +435,16 @@ def templatize(src, origin=None):
435 435
     for t in Lexer(src, origin).tokenize():
436 436
         if incomment:
437 437
             if t.token_type == TOKEN_BLOCK and t.contents == 'endcomment':
438  
-                content = u''.join(comment)
  438
+                content = ''.join(comment)
439 439
                 translators_comment_start = None
440 440
                 for lineno, line in enumerate(content.splitlines(True)):
441 441
                     if line.lstrip().startswith(TRANSLATOR_COMMENT_MARK):
442 442
                         translators_comment_start = lineno
443 443
                 for lineno, line in enumerate(content.splitlines(True)):
444 444
                     if translators_comment_start is not None and lineno >= translators_comment_start:
445  
-                        out.write(u' # %s' % line)
  445
+                        out.write(' # %s' % line)
446 446
                     else:
447  
-                        out.write(u' #\n')
  447
+                        out.write(' #\n')
448 448
                 incomment = False
449 449
                 comment = []
450 450
             else:
7  tests/regressiontests/i18n/commands/templates/test.html
@@ -50,3 +50,10 @@
50 50
 {% comment %}  Translators: Two-line translator comment #4
51 51
 continued here.{% endcomment %}
52 52
 {% trans "Translatable literal #4b" %}
  53
+
  54
+{% comment %} Translators: One-line translator comment #5 -- with non ASCII characters: áéíóúö{% endcomment %}
  55
+{% trans "Translatable literal #5a" %}
  56
+
  57
+{% comment %}  Translators: Two-line translator comment #5 -- with non ASCII characters: áéíóúö
  58
+continued here.{% endcomment %}
  59
+{% trans "Translatable literal #6b" %}

0 notes on commit 0defa7d

Please sign in to comment.
Something went wrong with that request. Please try again.