Author: ramiro Date: 2011-04-18 13:00:10 -0700 (Mon, 18 Apr 2011) New Revision: 16038
Modified: django/trunk/django/utils/translation/trans_real.py django/trunk/tests/regressiontests/i18n/commands/templates/test.html Log: Fixed #15848 -- Fixed regression introduced in [15882] in makemessages management command when processing multi-line comments that contain non-ASCCI characters in templates. Thanks for the report Denis Drescher. Modified: django/trunk/django/utils/translation/trans_real.py =================================================================== --- django/trunk/django/utils/translation/trans_real.py 2011-04-17 20:55:26 UTC (rev 16037) +++ django/trunk/django/utils/translation/trans_real.py 2011-04-18 20:00:10 UTC (rev 16038) @@ -435,16 +435,16 @@ for t in Lexer(src, origin).tokenize(): if incomment: if t.token_type == TOKEN_BLOCK and t.contents == 'endcomment': - content = u''.join(comment) + content = ''.join(comment) translators_comment_start = None for lineno, line in enumerate(content.splitlines(True)): if line.lstrip().startswith(TRANSLATOR_COMMENT_MARK): translators_comment_start = lineno for lineno, line in enumerate(content.splitlines(True)): if translators_comment_start is not None and lineno >= translators_comment_start: - out.write(u' # %s' % line) + out.write(' # %s' % line) else: - out.write(u' #\n') + out.write(' #\n') incomment = False comment = [] else: Modified: django/trunk/tests/regressiontests/i18n/commands/templates/test.html =================================================================== --- django/trunk/tests/regressiontests/i18n/commands/templates/test.html 2011-04-17 20:55:26 UTC (rev 16037) +++ django/trunk/tests/regressiontests/i18n/commands/templates/test.html 2011-04-18 20:00:10 UTC (rev 16038) @@ -50,3 +50,10 @@ {% comment %} Translators: Two-line translator comment #4 continued here.{% endcomment %} {% trans "Translatable literal #4b" %} + +{% comment %} Translators: One-line translator comment #5 -- with non ASCII characters: áéíóúö{% endcomment %} +{% trans "Translatable literal #5a" %} + +{% comment %} Translators: Two-line translator comment #5 -- with non ASCII characters: áéíóúö +continued here.{% endcomment %} +{% trans "Translatable literal #6b" %} -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.