equal
deleted
inserted
replaced
3 # posplit - split messages in paragraphs on .po/.pot files |
3 # posplit - split messages in paragraphs on .po/.pot files |
4 # |
4 # |
5 # license: MIT/X11/Expat |
5 # license: MIT/X11/Expat |
6 # |
6 # |
7 |
7 |
8 from __future__ import absolute_import |
8 from __future__ import absolute_import, print_function |
9 |
9 |
10 import polib |
10 import polib |
11 import re |
11 import re |
12 import sys |
12 import sys |
13 |
13 |
67 # only rst syntax, nothing to translate |
67 # only rst syntax, nothing to translate |
68 delta += 2 |
68 delta += 2 |
69 continue |
69 continue |
70 else: |
70 else: |
71 # lines following directly, unexpected |
71 # lines following directly, unexpected |
72 print 'Warning: text follows line with directive' \ |
72 print('Warning: text follows line with directive' \ |
73 ' %s' % directive |
73 ' %s' % directive) |
74 comment = 'do not translate: .. %s::' % directive |
74 comment = 'do not translate: .. %s::' % directive |
75 if not newentry.comment: |
75 if not newentry.comment: |
76 newentry.comment = comment |
76 newentry.comment = comment |
77 elif comment not in newentry.comment: |
77 elif comment not in newentry.comment: |
78 newentry.comment += '\n' + comment |
78 newentry.comment += '\n' + comment |