equal
deleted
inserted
replaced
76 paragraphs = message.split(u'\n\n') |
76 paragraphs = message.split(u'\n\n') |
77 else: |
77 else: |
78 paragraphs = [p.decode("ascii") for p in message.split('\n\n')] |
78 paragraphs = [p.decode("ascii") for p in message.split('\n\n')] |
79 # Be careful not to translate the empty string -- it holds the |
79 # Be careful not to translate the empty string -- it holds the |
80 # meta data of the .po file. |
80 # meta data of the .po file. |
81 u = u'\n\n'.join([p and _ugettext(p) or '' for p in paragraphs]) |
81 u = u'\n\n'.join([p and _ugettext(p) or u'' for p in paragraphs]) |
82 try: |
82 try: |
83 # encoding.tolocal cannot be used since it will first try to |
83 # encoding.tolocal cannot be used since it will first try to |
84 # decode the Unicode string. Calling u.decode(enc) really |
84 # decode the Unicode string. Calling u.decode(enc) really |
85 # means u.encode(sys.getdefaultencoding()).decode(enc). Since |
85 # means u.encode(sys.getdefaultencoding()).decode(enc). Since |
86 # the Python encoding defaults to 'ascii', this fails if the |
86 # the Python encoding defaults to 'ascii', this fails if the |