i18n: leave out entries which contain only rst syntax
authorSimon Heimberg <simohe@besonet.ch>
Mon, 03 Feb 2014 21:34:13 +0100
changeset 20363 e3ee7ec85a15
parent 20362 1bce1078501d
child 20364 a6cf48b2880d
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
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