Skip to content

Commit 60d35b0

Browse files
author
Alexander Smishlajev
committed
escape newlines
1 parent e2b21bc commit 60d35b0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

roundup/cgi/TAL/talgettext.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
##############################################################################
1515
# Modifications for Roundup:
1616
# 1. commented out ITALES references
17-
# 2. escape quotes in msgids
17+
# 2. escape quotes and line feeds in msgids
1818

1919
"""Program to extract internationalization markup from Page Templates.
2020
@@ -43,7 +43,7 @@
4343
#from ITALES import ITALESEngine
4444
from roundup.cgi.TAL.TALDefs import TALESError
4545

46-
__version__ = '$Revision: 1.4 $'
46+
__version__ = '$Revision: 1.5 $'
4747

4848
pot_header = '''\
4949
# SOME DESCRIPTIVE TITLE.
@@ -305,7 +305,8 @@ def write(self, s):
305305
for filename, position in positions:
306306
outfile.write('#: %s:%s\n' % (filename, position[0]))
307307

308-
outfile.write('msgid "%s"\n' % msgid.replace('"', '\\"'))
308+
outfile.write('msgid "%s"\n'
309+
% msgid.replace('"', '\\"').replace("\n", '\\n"\n"'))
309310
outfile.write('msgstr ""\n')
310311
outfile.write('\n')
311312

0 commit comments

Comments
 (0)