# HG changeset patch # User Simon Heimberg # Date 1391459653 -3600 # Node ID e3ee7ec85a15831780985fce73b9545f00c2dac1 # Parent 1bce1078501d9fec7effe432fc6f2d080e83ebc1 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 diff -r 1bce1078501d -r e3ee7ec85a15 i18n/posplit --- 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