changeset 20363:e3ee7ec85a15

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
author Simon Heimberg <simohe@besonet.ch>
date Mon, 03 Feb 2014 21:34:13 +0100
parents 1bce1078501d
children a6cf48b2880d
files i18n/posplit
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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