[PATCH 6 of 9] i18n: leave out entries which contain only a rst directive

Simon Heimberg simohe at besonet.ch
Mon Feb 3 15:00:26 CST 2014


# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1391459628 -3600
#      Mon Feb 03 21:33:48 2014 +0100
# Branch stable
# Node ID 8b76292a20964ec1408d71a73de0ea327603545d
# Parent  29f2394ae65247c28c388d832ecf286a4526ee79
i18n: leave out entries which contain only a rst directive

This prevents the danger of translating entries like ".. note::"

diff -r 29f2394ae652 -r 8b76292a2096 i18n/posplit
--- a/i18n/posplit	Wed Jan 29 16:56:00 2014 +0100
+++ b/i18n/posplit	Mon Feb 03 21:33:48 2014 +0100
@@ -55,6 +55,9 @@
                 newentry = mkentry(entry, delta, msgid, msgstr)
                 mdirective = findd.match(msgid)
                 if mdirective:
+                    if not msgid[mdirective.end():].rstrip():
+                        # only directive, nothing to translate here
+                        continue
                     directive = mdirective.group(1)
                     comment = 'do not translate: .. %s::' % directive
                     if not newentry.comment:


More information about the Mercurial-devel mailing list