comparison babel/messages/pofile.py @ 430:70f72bc70a93

Fix for msgctxt parsing in PO files. Thanks to Asheesh Laroia for the patch. Closes #159.
author cmlenz
date Tue, 17 Mar 2009 22:26:03 +0000
parents 15541acbe8cb
children d2e9aaa7c91c
comparison
equal deleted inserted replaced
429:08e2d18163d9 430:70f72bc70a93
190 idx, msg = msg[1:].split(']') 190 idx, msg = msg[1:].split(']')
191 translations.append([int(idx), msg.lstrip()]) 191 translations.append([int(idx), msg.lstrip()])
192 else: 192 else:
193 translations.append([0, msg]) 193 translations.append([0, msg])
194 elif line.startswith('msgctxt'): 194 elif line.startswith('msgctxt'):
195 if messages:
196 _add_message()
195 in_msgid[0] = in_msgstr[0] = False 197 in_msgid[0] = in_msgstr[0] = False
196 context.append(line[7:].lstrip()) 198 context.append(line[7:].lstrip())
197 elif line.startswith('"'): 199 elif line.startswith('"'):
198 if in_msgid[0]: 200 if in_msgid[0]:
199 messages[-1] += u'\n' + line.rstrip() 201 messages[-1] += u'\n' + line.rstrip()
Copyright (C) 2012-2017 Edgewall Software