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

login
register
mail settings
Submitter Simon Heimberg
Date Feb. 3, 2014, 9 p.m.
Message ID <8b76292a20964ec1408d.1391461226@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/3447/
State Accepted
Commit 1bce1078501d9fec7effe432fc6f2d080e83ebc1
Headers show

Comments

Simon Heimberg - Feb. 3, 2014, 9 p.m.
# HG changeset patch
# User Simon Heimberg <simohe@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::"

Patch

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: