i18n: leave out entries which contain only rst syntax
This prevents the danger of translating entries like the following ones:
.. container:: verbose
.. input:: filename1.txt
--- a/i18n/posplit Mon Feb 03 21:33:48 2014 +0100
+++ b/i18n/posplit Mon Feb 03 21:34:13 2014 +0100
@@ -59,6 +59,14 @@
# only directive, nothing to translate here
continue
directive = mdirective.group(1)
+ if directive in ('container', 'include'):
+ if msgid.rstrip('\n').count('\n') == 0:
+ # only rst syntax, nothing to translate
+ continue
+ else:
+ # lines following directly, unexpected
+ print 'Warning: text follows line with directive' \
+ ' %s' % directive
comment = 'do not translate: .. %s::' % directive
if not newentry.comment:
newentry.comment = comment